diff libmpdemux/demuxer.c @ 32736:a25f55874cdd

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.
author reimar
date Thu, 27 Jan 2011 20:37:51 +0000
parents 10b9ac971ef6
children 26bbfa0249e0
line wrap: on
line diff
--- 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,