[Xfce4-commits] [apps/parole] 01/01: Get GST tags from streams

noreply at xfce.org noreply at xfce.org
Sat Feb 25 19:12:44 CET 2017


This is an automated email from the git hooks/post-receive script.

bluesabre pushed a commit to branch master
in repository apps/parole.

commit 1a952fe9b632969f5ecbdc4f783ae285959c435c
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Feb 25 13:12:38 2017 -0500

    Get GST tags from streams
---
 src/gst/parole-gst.c     | 19 +++++++++++++------
 src/misc/parole-stream.c |  2 ++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/gst/parole-gst.c b/src/gst/parole-gst.c
index ff3944a..6bcfe75 100644
--- a/src/gst/parole-gst.c
+++ b/src/gst/parole-gst.c
@@ -1033,6 +1033,10 @@ parole_gst_tag_list_get_cover_external (ParoleGst *gst)
                   NULL);
 
     filename = g_filename_from_uri(uri, NULL, NULL);
+    if (!filename)
+    {
+        return NULL;
+    }
 
     directory = g_path_get_dirname(filename);
 
@@ -1291,7 +1295,7 @@ parole_gst_get_meta_data_cdda (ParoleGst *gst, GstTagList *tag)
 }
 
 static void
-parole_gst_get_meta_data_local_file (ParoleGst *gst, GstTagList *tag)
+parole_gst_get_meta_data_file (ParoleGst *gst, GstTagList *tag)
 {
     gchar *str;
     GDate *date;
@@ -1359,9 +1363,12 @@ parole_gst_get_meta_data_local_file (ParoleGst *gst, GstTagList *tag)
     if ( gst_tag_list_get_uint (tag, GST_TAG_TRACK_NUMBER, &integer) )
     {
         TRACE ("track:%i", integer);
-        g_object_set (G_OBJECT (gst->priv->stream),
-                      "track", integer,
-                      NULL);
+        if (integer < 100)
+        {
+            g_object_set (G_OBJECT (gst->priv->stream),
+                          "track", integer,
+                          NULL);
+        }
     }
 
     if ( gst_tag_list_get_uint (tag, GST_TAG_BITRATE, &integer) )
@@ -1419,7 +1426,8 @@ parole_gst_get_meta_data (ParoleGst *gst, GstTagList *tag)
     switch ( media_type )
     {
         case PAROLE_MEDIA_TYPE_LOCAL_FILE:
-            parole_gst_get_meta_data_local_file (gst, tag);
+        case PAROLE_MEDIA_TYPE_REMOTE:
+            parole_gst_get_meta_data_file (gst, tag);
             break;
         case PAROLE_MEDIA_TYPE_CDDA:
             parole_gst_get_meta_data_cdda (gst, tag);
@@ -1427,7 +1435,6 @@ parole_gst_get_meta_data (ParoleGst *gst, GstTagList *tag)
         case PAROLE_MEDIA_TYPE_DVD:
             parole_gst_get_meta_data_dvd (gst);
             break;
-        case PAROLE_MEDIA_TYPE_REMOTE:
         case PAROLE_MEDIA_TYPE_UNKNOWN:
             parole_gst_get_meta_data_unknown (gst);
             break;
diff --git a/src/misc/parole-stream.c b/src/misc/parole-stream.c
index 8516e19..208fafd 100644
--- a/src/misc/parole-stream.c
+++ b/src/misc/parole-stream.c
@@ -119,6 +119,8 @@ parole_stream_get_media_type_from_uri (ParoleStream *stream, const gchar *uri)
 
     if ( g_str_has_prefix (uri, "file:/") )
         type = PAROLE_MEDIA_TYPE_LOCAL_FILE;
+    else if ( g_str_has_prefix (uri, "http:/") || g_str_has_prefix (uri, "https:/") )
+        type = PAROLE_MEDIA_TYPE_REMOTE;
     else if ( g_str_has_prefix (uri, "dvd:/") )
         type = PAROLE_MEDIA_TYPE_DVD;
     else if ( g_str_has_prefix (uri, "vcd:") )

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list