avfilter/af_asetnsamples: add missing error check

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2017-11-20 14:02:28 +01:00
parent bea8eeaa2c
commit 000836c2a9
1 changed files with 5 additions and 2 deletions

View File

@ -140,11 +140,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return -1;
}
}
av_audio_fifo_write(asns->fifo, (void **)insamples->extended_data, nb_samples);
if (asns->next_out_pts == AV_NOPTS_VALUE)
ret = av_audio_fifo_write(asns->fifo, (void **)insamples->extended_data, nb_samples);
if (ret > 0 && asns->next_out_pts == AV_NOPTS_VALUE)
asns->next_out_pts = insamples->pts;
av_frame_free(&insamples);
if (ret < 0)
return ret;
while (av_audio_fifo_size(asns->fifo) >= asns->nb_out_samples)
push_samples(outlink);
return 0;