commit 01f0a5ce3271cc133dbb26a9dc5553ddd1c51726
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Tue Jan 26 11:18:28 2010 +0100

    avidemux: ignore streams that finished
    
    When we receive an UNEXPECTED from a stream, move to the next stream and only go
    EOS when all streams are EOS. When selecting a stream to push, ignore streams
    that went EOS.
    
    Fixes #607949

diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c
index 6c47513..ac69143 100644
--- a/gst/avi/gstavidemux.c
+++ b/gst/avi/gstavidemux.c
@@ -4205,6 +4205,11 @@ gst_avi_demux_find_next (GstAviDemux * avi, gfloat rate)
     GstAviStream *stream;
 
     stream = &avi->stream[i];
+
+    /* ignore streams that finished */
+    if (stream->last_flow == GST_FLOW_UNEXPECTED)
+      continue;
+
     position = stream->current_timestamp;
 
     /* position of -1 is EOS */
@@ -4369,7 +4374,8 @@ eos_stop:
         " setting EOS (%" GST_TIME_FORMAT " > %" GST_TIME_FORMAT ")",
         GST_TIME_ARGS (timestamp), GST_TIME_ARGS (avi->segment.stop));
     ret = GST_FLOW_UNEXPECTED;
-    goto beach;
+    /* move to next stream */
+    goto next;
   }
 pull_failed:
   {
