Skip to content

Commit

Permalink
aufile: fixes for prm->duration
Browse files Browse the repository at this point in the history
In order to retrieve the duration a read handler or setting ptime
is not needed.
  • Loading branch information
cspiel1 committed Aug 9, 2024
1 parent 4550898 commit 77ee3c8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/aufile/aufile_src.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ int aufile_src_alloc(struct ausrc_st **stp, const struct ausrc *as,
struct aufile_prm fprm;
int err;

if (!stp || !as || !prm || !prm->ptime)
if (!stp || !as || !prm)
return EINVAL;

if (prm->fmt != AUFMT_S16LE) {
Expand All @@ -216,6 +216,8 @@ int aufile_src_alloc(struct ausrc_st **stp, const struct ausrc *as,
st->errh = errh;
st->arg = arg;
st->ptime = prm->ptime;
if (!st->ptime)
st->ptime = 20;

err = aufile_open(&st->aufile, &fprm, dev, AUFILE_READ);
if (err) {
Expand All @@ -231,10 +233,8 @@ int aufile_src_alloc(struct ausrc_st **stp, const struct ausrc *as,
prm->ch = fprm.channels;
prm->duration = aufile_get_length(st->aufile, &fprm);

if (!rh) {
mem_deref(st);
return 0;
}
if (!rh)
goto out;

st->prm = *prm;

Expand Down

0 comments on commit 77ee3c8

Please sign in to comment.