[longomatch] Query duration in the READY to PAUSED state transition.



commit 04d2eaaa9132cc64e5d0ed77508a0a7d1d2bd29d
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Mar 23 23:16:49 2010 +0100

    Query duration in the READY to PAUSED state transition.
    
    A regression or change in the API in playbin2 makes it
    sending the GST_MESSAGE_DURATION too soon and the pipeline
    is not ready yet for duration query.

 libcesarplayer/src/bacon-video-widget-gst-0.10.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libcesarplayer/src/bacon-video-widget-gst-0.10.c b/libcesarplayer/src/bacon-video-widget-gst-0.10.c
index 7beb315..fbe2fa5 100644
--- a/libcesarplayer/src/bacon-video-widget-gst-0.10.c
+++ b/libcesarplayer/src/bacon-video-widget-gst-0.10.c
@@ -1801,6 +1801,12 @@ bvw_bus_message_cb (GstBus * bus, GstMessage * message, gpointer data)
 				       GST_DEBUG_GRAPH_SHOW_ALL ^
 				       GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS,
 				       "totem-prerolled");
+        bvw->priv->stream_length = 0;
+        if (bacon_video_widget_get_stream_length (bvw) == 0)
+        {
+          GST_DEBUG ("Failed to query duration in PAUSED state?!");
+        }
+        break;
 	    bvw_update_stream_info (bvw);
 	    if (!bvw_check_missing_plugins_on_preroll (bvw))
 	      {
@@ -1847,12 +1853,12 @@ bvw_bus_message_cb (GstBus * bus, GstMessage * message, gpointer data)
     case GST_MESSAGE_DURATION:
       {
 	/* force _get_stream_length() to do new duration query */
-	bvw->priv->stream_length = 0;
+	/*bvw->priv->stream_length = 0;
 	if (bacon_video_widget_get_stream_length (bvw) == 0)
 	  {
 	    GST_DEBUG ("Failed to query duration after DURATION message?!");
 	  }
-	break;
+	break;*/
       }
 
     case GST_MESSAGE_CLOCK_PROVIDE:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]