[Xfce4-commits] <parole:master> For local media files, check the stream caps only when switching from ready to paused state. properly now.

Ali Abdallah noreply at xfce.org
Thu Jan 14 10:12:02 CET 2010


Updating branch refs/heads/master
         to b3aed0774d6bc1c7db040d3f4fb8d739b2afb094 (commit)
       from 89563c1ae389bc4b1b1b45fa7c3fccc509a60d86 (commit)

commit b3aed0774d6bc1c7db040d3f4fb8d739b2afb094
Author: Ali Abdallah <aliov at xfce.org>
Date:   Thu Jan 14 10:09:16 2010 +0100

    For local media files, check the stream caps only when switching from ready to paused state. properly now.

 gst/parole-gst.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/gst/parole-gst.c b/gst/parole-gst.c
index cb30a38..2a51a35 100644
--- a/gst/parole-gst.c
+++ b/gst/parole-gst.c
@@ -931,9 +931,22 @@ parole_gst_evaluate_state (ParoleGst *gst, GstState old, GstState new, GstState
 	}
 	case GST_STATE_PAUSED:
 	{
-	    parole_gst_query_duration (gst);
-	    parole_gst_query_capabilities (gst);
-	    parole_gst_query_info (gst);
+	    if ( pending == GST_STATE_PLAYING )
+	    {
+		ParoleMediaType media_type;
+		
+		g_object_get (G_OBJECT (gst->priv->stream),
+			      "media-type", &media_type,
+			      NULL);
+		
+		if ( (media_type == PAROLE_MEDIA_TYPE_LOCAL_FILE && old == GST_STATE_READY) ||
+		      media_type != PAROLE_MEDIA_TYPE_LOCAL_FILE )
+		{
+		    parole_gst_query_duration (gst);
+		    parole_gst_query_capabilities (gst);
+		    parole_gst_query_info (gst);
+		}
+	    }
 
 	    if ( gst->priv->target == GST_STATE_PLAYING )
 	    {
@@ -953,7 +966,7 @@ parole_gst_evaluate_state (ParoleGst *gst, GstState old, GstState new, GstState
 	    g_signal_emit (G_OBJECT (gst), signals [MEDIA_STATE], 0, 
 			   gst->priv->stream, PAROLE_MEDIA_STATE_STOPPED);
 
-	    if ( gst->priv->target == GST_STATE_PLAYING && pending != GST_STATE_PLAYING)
+	    if ( gst->priv->target == GST_STATE_PLAYING && pending < GST_STATE_PAUSED)
 	    {
 		parole_gst_play_file_internal (gst);
 	    }



More information about the Xfce4-commits mailing list