# HG changeset patch # User reimar # Date 1296160671 0 # Node ID a25f55874cddf97e172de2f620930d4af00647fa # Parent c8b9c17890cbfe0a819bd09e07fbba78b06aaab3 Improve EOF handling in ds_fill_buffer for the case where one stream ends much earlier than the others, in particular make sure the "too many ..." message is not printed over and over. diff -r c8b9c17890cb -r a25f55874cdd libmpdemux/demuxer.c --- a/libmpdemux/demuxer.c Thu Jan 27 19:34:40 2011 +0000 +++ b/libmpdemux/demuxer.c Thu Jan 27 20:37:51 2011 +0000 @@ -642,6 +642,8 @@ while (1) { if (ds->packs) { demux_packet_t *p = ds->first; + // obviously not yet EOF after all + ds->eof = 0; #if 0 if (demux->reference_clock != MP_NOPTS_VALUE) { if ( p->pts != MP_NOPTS_VALUE @@ -676,6 +678,9 @@ --ds->packs; return 1; } + // avoid printing the "too many ..." message over and over + if (ds->eof) + break; if (demux->audio->packs >= MAX_PACKS || demux->audio->bytes >= MAX_PACK_BYTES) { mp_msg(MSGT_DEMUXER, MSGL_ERR, MSGTR_TooManyAudioInBuffer,