changeset 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 c8b9c17890cb
children ce0b4f3bb12d
files libmpdemux/demuxer.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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,