[SCM] gmtk/experimental: Apply some patches from upstream

sramacher at users.alioth.debian.org sramacher at users.alioth.debian.org
Sun May 26 14:04:34 UTC 2013


The following commit has been merged in the experimental branch:
commit 1420b46f120b116d79350ddb997e311ef7b9c71d
Author: Sebastian Ramacher <sramacher at debian.org>
Date:   Sun May 26 16:03:11 2013 +0200

    Apply some patches from upstream

diff --git a/debian/changelog b/debian/changelog
index 44a4438..fd4317a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+gmtk (1.0.8-2) UNRELEASED; urgency=low
+
+  * debian/patches:
+    - locale-agnostic.patch: Apply patch from upstream to pass floats in a
+      locale agnostic way to mplayer. (LP: #1182874)
+    - metadata-handling.patch: Apply patch from upstream to improve handling
+      of metadata reported by mplayer.
+    - input.conf-error.patch: Apply patch from upstream to not display an
+      error message if input.conf could not be found.
+
+ -- Sebastian Ramacher <sramacher at debian.org>  Sun, 26 May 2013 14:34:19 +0200
+
 gmtk (1.0.8-1) experimental; urgency=low
 
   * New upstream release
diff --git a/debian/patches/input.conf-error.patch b/debian/patches/input.conf-error.patch
new file mode 100644
index 0000000..0be8691
--- /dev/null
+++ b/debian/patches/input.conf-error.patch
@@ -0,0 +1,15 @@
+Description: gmtk_media_player - exclude input.conf from file not found message
+Origin: upstream,
+ https://code.google.com/p/gmtk/source/detail?r=213
+Last-Update: 2013-05-26
+
+--- a/src/gmtk_media_player.c
++++ b/src/gmtk_media_player.c
+@@ -3056,6 +3056,7 @@
+ 
+         if (strstr(mplayer_output->str, "Failed to open") != NULL) {
+             if (strstr(mplayer_output->str, "LIRC") == NULL &&
++                strstr(mplayer_output->str, "input.conf") == NULL &&
+                 strstr(mplayer_output->str, "/dev/rtc") == NULL &&
+                 strstr(mplayer_output->str, "VDPAU") == NULL && strstr(mplayer_output->str, "registry file") == NULL) {
+                 if (strstr(mplayer_output->str, "<") == NULL && strstr(mplayer_output->str, ">") == NULL
diff --git a/debian/patches/locale-agnostic.patch b/debian/patches/locale-agnostic.patch
new file mode 100644
index 0000000..b1c98d9
--- /dev/null
+++ b/debian/patches/locale-agnostic.patch
@@ -0,0 +1,135 @@
+Description: Pass floats to mplayer in a locale agnostic way
+Origin: upstream,
+ https://code.google.com/p/gmtk/source/detail?r=217
+Last-Update: 2013-05-26
+
+--- a/src/gmtk_media_player.c
++++ b/src/gmtk_media_player.c
+@@ -1347,6 +1347,7 @@
+                                             GmtkMediaPlayerMediaAttributes attribute, gdouble value)
+ {
+     gchar *cmd;
++    gchar *tmp;
+ 
+     switch (attribute) {
+     case ATTRIBUTE_CACHE_SIZE:
+@@ -1373,9 +1374,16 @@
+         player->speed_multiplier = CLAMP(value, 0.1, 10.0);
+         if (player->player_state == PLAYER_STATE_RUNNING) {
+             if (player->speed_multiplier == 1.0) {
+-                cmd = g_strdup_printf("speed_set %f\n", player->speed_multiplier);
++                tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++                tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->speed_multiplier);
++                cmd = g_strdup_printf("speed_set %s\n", tmp);
++                g_free(tmp);
++
+             } else {
+-                cmd = g_strdup_printf("speed_mult %f\n", player->speed_multiplier);
++                tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++                tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->speed_multiplier);
++                cmd = g_strdup_printf("speed_mult %s\n", tmp);
++                g_free(tmp);
+             }
+             write_to_mplayer(player, cmd);
+             g_free(cmd);
+@@ -1387,7 +1395,10 @@
+     case ATTRIBUTE_SPEED_SET:
+         player->speed = CLAMP(value, 0.1, 10.0);
+         if (player->player_state == PLAYER_STATE_RUNNING) {
+-            cmd = g_strdup_printf("speed_set %f\n", player->speed);
++            tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++            tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->speed);
++            cmd = g_strdup_printf("speed_set %s\n", tmp);
++            g_free(tmp);
+             write_to_mplayer(player, cmd);
+             g_free(cmd);
+             cmd = NULL;
+@@ -1398,7 +1409,11 @@
+     case ATTRIBUTE_SUBTITLE_SCALE:
+         player->subtitle_scale = CLAMP(value, 0.2, 100.0);
+         if (player->player_state == PLAYER_STATE_RUNNING) {
+-            cmd = g_strdup_printf("sub_scale %f 1\n", player->subtitle_scale);
++            tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++            tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->subtitle_scale);
++            cmd = g_strdup_printf("sub_scale %s\n", tmp);
++            g_free(tmp);
++
+             write_to_mplayer(player, cmd);
+             g_free(cmd);
+             cmd = NULL;
+@@ -1408,7 +1423,10 @@
+     case ATTRIBUTE_SUBTITLE_DELAY:
+         player->subtitle_delay = value;
+         if (player->player_state == PLAYER_STATE_RUNNING) {
+-            cmd = g_strdup_printf("set_property sub_delay %f 1\n", player->subtitle_delay);
++            tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++            tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->subtitle_delay);
++            cmd = g_strdup_printf("set_property sub_delay %s\n", tmp);
++            g_free(tmp);
+             write_to_mplayer(player, cmd);
+             g_free(cmd);
+             cmd = NULL;
+@@ -1418,7 +1436,10 @@
+     case ATTRIBUTE_AUDIO_DELAY:
+         player->audio_delay = CLAMP(value, -100.0, 100.0);
+         if (player->player_state == PLAYER_STATE_RUNNING) {
+-            cmd = g_strdup_printf("set_property audio_delay %f 1\n", player->audio_delay);
++            tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++            tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->audio_delay);
++            cmd = g_strdup_printf("set_property audio_delay %s\n", tmp);
++            g_free(tmp);
+             write_to_mplayer(player, cmd);
+             g_free(cmd);
+             cmd = NULL;
+@@ -2482,12 +2503,18 @@
+ 
+         if ((gint) (player->start_time) > 0) {
+             argv[argn++] = g_strdup_printf("-ss");
+-            argv[argn++] = g_strdup_printf("%f", player->start_time);
++            tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++            tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->start_time);
++            argv[argn++] = g_strdup(tmp);
++            g_free(tmp);
+         }
+ 
+         if ((gint) (player->run_time) > 0) {
+             argv[argn++] = g_strdup_printf("-endpos");
+-            argv[argn++] = g_strdup_printf("%f", player->run_time);
++            tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++            tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->run_time);
++            argv[argn++] = g_strdup(tmp);
++            g_free(tmp);
+         }
+ 
+         if (player->frame_drop)
+@@ -2500,10 +2527,16 @@
+         argv[argn++] = g_strdup_printf("%i", player->osdlevel);
+ 
+         argv[argn++] = g_strdup_printf("-delay");
+-        argv[argn++] = g_strdup_printf("%f", player->audio_delay);
++        tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++        tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->audio_delay);
++        argv[argn++] = g_strdup(tmp);
++        g_free(tmp);
+ 
+         argv[argn++] = g_strdup_printf("-subdelay");
+-        argv[argn++] = g_strdup_printf("%f", player->subtitle_delay);
++        tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++        tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->subtitle_delay);
++        argv[argn++] = g_strdup(tmp);
++        g_free(tmp);
+ 
+         argv[argn++] = g_strdup_printf("-subpos");
+         argv[argn++] = g_strdup_printf("%i", player->subtitle_position);
+@@ -2597,7 +2630,10 @@
+             }
+ 
+             argv[argn++] = g_strdup_printf("-ass-font-scale");
+-            argv[argn++] = g_strdup_printf("%1.2f", player->subtitle_scale);
++            tmp = g_new0(char, G_ASCII_DTOSTR_BUF_SIZE);
++            tmp = g_ascii_dtostr(tmp, G_ASCII_DTOSTR_BUF_SIZE, player->subtitle_scale);
++            argv[argn++] = g_strdup(tmp);
++            g_free(tmp);
+ 
+             if (player->subtitle_color != NULL && strlen(player->subtitle_color) > 0) {
+                 argv[argn++] = g_strdup_printf("-ass-color");
diff --git a/debian/patches/metadata-handling.patch b/debian/patches/metadata-handling.patch
new file mode 100644
index 0000000..31c5ec4
--- /dev/null
+++ b/debian/patches/metadata-handling.patch
@@ -0,0 +1,260 @@
+Description: Use case inspecific parsing of metadata attributes fixes
+Origin: upstream,
+ https://code.google.com/p/gmtk/source/detail?r=212
+Last-Update: 2013-05-06
+
+--- a/src/gmtk_media_player.c
++++ b/src/gmtk_media_player.c
+@@ -477,6 +477,12 @@
+     player->album = NULL;
+     player->disposed = FALSE;
+     player->player_lock = g_mutex_new();
++    player->name_regex = g_regex_new(".*name\\s*:\\s*(.*)\n", G_REGEX_CASELESS, 0, NULL);
++    player->genre_regex = g_regex_new(".*genre\\s*:\\s*(.*)\n", G_REGEX_CASELESS, 0, NULL);
++    player->title_regex = g_regex_new(".*title\\s*:\\s*(.*)\n", G_REGEX_CASELESS, 0, NULL);
++    player->artist_regex = g_regex_new(".*artist\\s*:\\s*(.*)\n", G_REGEX_CASELESS, 0, NULL);
++    player->album_regex = g_regex_new(".*album\\s*:\\s*(.*)\n", G_REGEX_CASELESS, 0, NULL);
++
+     gmtk_media_player_log_state(player, "after init");
+ }
+ 
+@@ -1775,6 +1781,14 @@
+         }
+         break;
+ 
++    case ATTRIBUTE_GENRE:
++        if (player->genre == NULL || strlen(player->genre) == 0) {
++            value = NULL;
++        } else {
++            value = player->genre;
++        }
++        break;
++
+     case ATTRIBUTE_PROFILE:
+         value = player->profile;
+         break;
+@@ -3161,6 +3175,8 @@
+     GmtkMediaPlayerAudioTrack *audio_track = NULL;
+     GList *iter;
+     GtkWidget *dialog;
++    gchar **split;
++    gint index;
+ 
+     if (player == NULL) {
+         gm_log(player->debug, G_LOG_LEVEL_MESSAGE, "player is NULL");
+@@ -3635,94 +3651,119 @@
+             gtk_widget_destroy(dialog);
+         }
+ 
+-        if (strstr(mplayer_output->str, "Name   : ") != 0) {
+-            buf = strstr(mplayer_output->str, "Name   : ");
+-            buf = strstr(mplayer_output->str, "Name   : ") + strlen("Name   : ");
+-            buf = g_strchomp(buf);
+-            if (player->title != NULL) {
+-                g_free(player->title);
+-                player->title = NULL;
+-            }
++        if (g_regex_match(player->name_regex, mplayer_output->str, 0, NULL)) {
++            split = g_regex_split(player->name_regex, mplayer_output->str, 0);
++            index = 0;
++            while (split[index]) {
++                if (strlen(split[index]) > 0) {
++                    if (player->title != NULL) {
++                        g_free(player->title);
++                        player->title = NULL;
++                    }
+ 
+-            player->title = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
+-            if (player->title == NULL) {
+-                player->title = g_strdup(buf);
+-                gm_str_strip_unicode(player->title, strlen(player->title));
++                    player->title = g_locale_to_utf8(split[index], -1, NULL, NULL, NULL);
++                    if (player->title == NULL) {
++                        player->title = g_strdup(split[index]);
++                        gm_str_strip_unicode(player->title, strlen(player->title));
++                    }
++                    player->has_metadata = TRUE;
++                    create_event_int(player, "attribute-changed", ATTRIBUTE_TITLE);
++                }
++                index++;
+             }
+-            player->has_metadata = TRUE;
+-            create_event_int(player, "attribute-changed", ATTRIBUTE_TITLE);
++            g_strfreev(split);
+         }
+ 
+-        if (strstr(mplayer_output->str, "Genre  : ") != 0) {
+-            buf = strstr(mplayer_output->str, "Genre  : ");
+-            buf = strstr(mplayer_output->str, "Genre  : ") + strlen("Genre  : ");
+-            buf = g_strchomp(buf);
+-            if (player->artist != NULL) {
+-                g_free(player->artist);
+-                player->artist = NULL;
+-            }
++        if (g_regex_match(player->genre_regex, mplayer_output->str, 0, NULL)) {
++            split = g_regex_split(player->genre_regex, mplayer_output->str, 0);
++            index = 0;
++            while (split[index]) {
++                if (strlen(split[index]) > 0) {
++                    if (player->title != NULL) {
++                        g_free(player->genre);
++                        player->title = NULL;
++                    }
+ 
+-            player->artist = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
+-            if (player->artist == NULL) {
+-                player->artist = g_strdup(buf);
+-                gm_str_strip_unicode(player->artist, strlen(player->artist));
++                    player->genre = g_locale_to_utf8(split[index], -1, NULL, NULL, NULL);
++                    if (player->genre == NULL) {
++                        player->genre = g_strdup(split[index]);
++                        gm_str_strip_unicode(player->genre, strlen(player->genre));
++                    }
++                    player->has_metadata = TRUE;
++                    create_event_int(player, "attribute-changed", ATTRIBUTE_GENRE);
++                }
++                index++;
+             }
+-            player->has_metadata = TRUE;
+-            create_event_int(player, "attribute-changed", ATTRIBUTE_ARTIST);
++            g_strfreev(split);
+         }
+ 
+-        if (strstr(mplayer_output->str, "Title: ") != 0) {
+-            buf = strstr(mplayer_output->str, "Title:");
+-            buf = strstr(mplayer_output->str, "Title: ") + strlen("Title: ");
+-            buf = g_strchomp(buf);
+-            if (player->title != NULL) {
+-                g_free(player->title);
+-                player->title = NULL;
+-            }
++        if (g_regex_match(player->title_regex, mplayer_output->str, 0, NULL)) {
++            split = g_regex_split(player->title_regex, mplayer_output->str, 0);
++            index = 0;
++            while (split[index]) {
++                if (strlen(split[index]) > 0) {
++                    if (player->title != NULL) {
++                        g_free(player->title);
++                        player->title = NULL;
++                    }
+ 
+-            player->title = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
+-            if (player->title == NULL) {
+-                player->title = g_strdup(buf);
+-                gm_str_strip_unicode(player->title, strlen(player->title));
++                    player->title = g_locale_to_utf8(split[index], -1, NULL, NULL, NULL);
++                    if (player->title == NULL) {
++                        player->title = g_strdup(split[index]);
++                        gm_str_strip_unicode(player->title, strlen(player->title));
++                    }
++                    player->has_metadata = TRUE;
++                    create_event_int(player, "attribute-changed", ATTRIBUTE_TITLE);
++                }
++                index++;
+             }
+-            player->has_metadata = TRUE;
+-            create_event_int(player, "attribute-changed", ATTRIBUTE_TITLE);
++            g_strfreev(split);
+         }
+ 
+-        if (strstr(mplayer_output->str, "Artist: ") != 0) {
+-            buf = strstr(mplayer_output->str, "Artist:");
+-            buf = strstr(mplayer_output->str, "Artist: ") + strlen("Artist: ");
+-            buf = g_strchomp(buf);
+-            if (player->artist != NULL) {
+-                g_free(player->artist);
+-                player->artist = NULL;
+-            }
++        if (g_regex_match(player->artist_regex, mplayer_output->str, 0, NULL)) {
++            split = g_regex_split(player->artist_regex, mplayer_output->str, 0);
++            index = 0;
++            while (split[index]) {
++                if (strlen(split[index]) > 0) {
++                    if (player->artist != NULL) {
++                        g_free(player->artist);
++                        player->artist = NULL;
++                    }
+ 
+-            player->artist = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
+-            if (player->artist == NULL) {
+-                player->artist = g_strdup(buf);
+-                gm_str_strip_unicode(player->artist, strlen(player->artist));
++                    player->artist = g_locale_to_utf8(split[index], -1, NULL, NULL, NULL);
++                    if (player->artist == NULL) {
++                        player->artist = g_strdup(split[index]);
++                        gm_str_strip_unicode(player->artist, strlen(player->artist));
++                    }
++                    player->has_metadata = TRUE;
++                    create_event_int(player, "attribute-changed", ATTRIBUTE_ARTIST);
++                }
++                index++;
+             }
+-            player->has_metadata = TRUE;
+-            create_event_int(player, "attribute-changed", ATTRIBUTE_ARTIST);
++            g_strfreev(split);
+         }
+ 
+-        if (strstr(mplayer_output->str, "Album: ") != 0) {
+-            buf = strstr(mplayer_output->str, "Album:");
+-            buf = strstr(mplayer_output->str, "Album: ") + strlen("Album: ");
+-            buf = g_strchomp(buf);
+-            if (player->album != NULL) {
+-                g_free(player->album);
+-                player->album = NULL;
+-            }
++        if (g_regex_match(player->album_regex, mplayer_output->str, 0, NULL)) {
++            split = g_regex_split(player->album_regex, mplayer_output->str, 0);
++            index = 0;
++            while (split[index]) {
++                if (strlen(split[index]) > 0) {
++                    if (player->album != NULL) {
++                        g_free(player->album);
++                        player->album = NULL;
++                    }
+ 
+-            player->album = g_locale_to_utf8(buf, -1, NULL, NULL, NULL);
+-            if (player->album == NULL) {
+-                player->album = g_strdup(buf);
+-                gm_str_strip_unicode(player->album, strlen(player->album));
++                    player->album = g_locale_to_utf8(split[index], -1, NULL, NULL, NULL);
++                    if (player->album == NULL) {
++                        player->album = g_strdup(split[index]);
++                        gm_str_strip_unicode(player->album, strlen(player->album));
++                    }
++                    player->has_metadata = TRUE;
++                    create_event_int(player, "attribute-changed", ATTRIBUTE_ALBUM);
++                }
++                index++;
+             }
+-            player->has_metadata = TRUE;
+-            create_event_int(player, "attribute-changed", ATTRIBUTE_ALBUM);
++            g_strfreev(split);
+         }
+ 
+         if (player->minimum_mplayer == FALSE) {
+--- a/src/gmtk_media_player.h
++++ b/src/gmtk_media_player.h
+@@ -182,7 +182,8 @@
+     ATTRIBUTE_PROFILE,
+     ATTRIBUTE_PREFERRED_AUDIO_LANGUAGE,
+     ATTRIBUTE_PREFERRED_SUBTITLE_LANGUAGE,
+-    ATTRIBUTE_SPEED_SET
++    ATTRIBUTE_SPEED_SET,
++    ATTRIBUTE_GENRE
+ } GmtkMediaPlayerMediaAttributes;
+ 
+ typedef enum {
+@@ -398,6 +399,13 @@
+ 
+     gboolean disposed;
+     GMutex *player_lock;
++    gchar *genre;
++    GRegex *name_regex;
++    GRegex *genre_regex;
++    GRegex *title_regex;
++    GRegex *artist_regex;
++    GRegex *album_regex;
++
+ };
+ 
+ struct _GmtkMediaPlayerClass {
diff --git a/debian/patches/series b/debian/patches/series
index fe04dc8..e7d1a0a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,5 @@
 0002-hide-private-symbols.patch
 0003-use-soname-as-domain.patch
+metadata-handling.patch
+input.conf-error.patch
+locale-agnostic.patch

-- 
gmtk packaging



More information about the pkg-multimedia-commits mailing list