tools/gst-launch.c: Give more interesting info when buffering starts and stops.
authorWim Taymans <wim.taymans@gmail.com>
Sat, 12 May 2007 15:38:02 +0000 (15:38 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sat, 12 May 2007 15:38:02 +0000 (15:38 +0000)
Original commit message from CVS:
* tools/gst-launch.c: (event_loop):
Give more interesting info when buffering starts and stops.
Fix case where buffering starts but we fail to update the buffering flag
because the target state is not PLAYING.

ChangeLog
tools/gst-launch.c

index 5166ee1..7f48961 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-05-12  Wim Taymans  <wim@fluendo.com>
 
+       * tools/gst-launch.c: (event_loop):
+       Give more interesting info when buffering starts and stops.
+       Fix case where buffering starts but we fail to update the buffering flag
+       because the target state is not PLAYING.
+
+2007-05-12  Wim Taymans  <wim@fluendo.com>
+
        * plugins/elements/gstqueue.c: (gst_queue_init),
        (gst_queue_finalize), (update_time_level), (apply_segment),
        (apply_buffer), (gst_queue_locked_flush),
index dd8a832..fb276f3 100644 (file)
@@ -482,8 +482,11 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
 
         /* ignore when we are buffering since then we mess with the states
          * ourselves. */
-        if (buffering)
+        if (buffering) {
+          fprintf (stderr,
+              _("Prerolled, waiting for buffering to finish...\n"));
           break;
+        }
 
         /* if we reached the final target state, exit */
         if (target_state == GST_STATE_PAUSED && new == target_state)
@@ -503,7 +506,8 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
           buffering = FALSE;
           /* if the desired state is playing, go back */
           if (target_state == GST_STATE_PLAYING) {
-            fprintf (stderr, _("Setting pipeline to PLAYING ...\n"));
+            fprintf (stderr,
+                _("Done buffering, setting pipeline to PLAYING ...\n"));
             gst_element_set_state (pipeline, GST_STATE_PLAYING);
           } else
             goto exit;
@@ -511,10 +515,10 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
           /* buffering busy */
           if (buffering == FALSE && target_state == GST_STATE_PLAYING) {
             /* we were not buffering but PLAYING, PAUSE  the pipeline. */
-            fprintf (stderr, _("Setting pipeline to PAUSED ...\n"));
+            fprintf (stderr, _("Buffering, setting pipeline to PAUSED ...\n"));
             gst_element_set_state (pipeline, GST_STATE_PAUSED);
-            buffering = TRUE;
           }
+          buffering = TRUE;
         }
         break;
       }