audio: fix EOF handling if nothing could be decoded at all

The code for decoding the initial frame has to handle this explicitly.
This commit is contained in:
wm4 2016-02-06 18:33:31 +01:00
parent fb5f732798
commit a0d3ce4819
1 changed files with 4 additions and 0 deletions

View File

@ -732,6 +732,10 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
int r = decode_new_frame(mpctx->ao_chain);
if (r == AD_WAIT)
return; // continue later when new data is available
if (r == AD_EOF) {
mpctx->audio_status = STATUS_EOF;
return;
}
reinit_audio_filters_and_output(mpctx);
mpctx->sleeptime = 0;
return; // try again next iteration