Added EOS, add yield to avoid infinite loop
authorWim Taymans <wim.taymans@gmail.com>
Mon, 24 Dec 2001 12:29:33 +0000 (12:29 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 24 Dec 2001 12:29:33 +0000 (12:29 +0000)
Original commit message from CVS:
Added EOS, add yield to avoid infinite loop

ext/mikmod/gstmikmod.c

index a8b6a34..adca578 100644 (file)
@@ -405,10 +405,16 @@ gst_mikmod_loop (GstElement *element)
                                    ));
                                    
   do {
-    if ( Player_Active() )
+    if ( Player_Active() ) {
       drv_gst.Update();
-  
-    gst_element_yield (element);
+
+      gst_element_yield (element);
+    }
+    else {
+      gst_element_set_state (GST_ELEMENT (mikmod), GST_STATE_PAUSED);
+      gst_pad_push (mikmod->srcpad, gst_event_new (GST_EVENT_EOS));
+    }
+
   } 
   while ( 1 );
 }