Even more bugfixes backported from upstream svn:

fix speed multipliers and speed reset
fix segfaults in gmtk_media_player when defining a specific font
This commit is contained in:
dcoppa 2011-10-17 13:50:34 +00:00
parent ba89972e6c
commit 5bed7cb23f
4 changed files with 96 additions and 19 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.47 2011/09/29 11:03:19 dcoppa Exp $
# $OpenBSD: Makefile,v 1.48 2011/10/17 13:50:34 dcoppa Exp $
COMMENT = GTK+/GNOME frontend for MPlayer
DISTNAME = gnome-mplayer-1.0.4
REVISION = 4
REVISION = 5
CATEGORIES = x11 multimedia
MAINTAINER = David Coppa <dcoppa@openbsd.org>

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_gui_c,v 1.19 2011/09/29 11:03:19 dcoppa Exp $
$OpenBSD: patch-src_gui_c,v 1.20 2011/10/17 13:50:34 dcoppa Exp $
Fix an issue when alsa is not being used
(upstream svn revision r2151)
@ -21,8 +21,10 @@ Bugfix: 'f' not going to/returning from fullscreen
Fix problem with seeking in the tracker
(upstream svn revision r2176)
Fix speed multipliers and speed reset (upstream svn revision r2180)
--- src/gui.c.orig Mon Jun 27 16:59:45 2011
+++ src/gui.c Wed Sep 28 15:34:17 2011
+++ src/gui.c Mon Oct 17 14:53:08 2011
@@ -106,6 +106,7 @@ PLAYSTATE media_state_to_playstate(GmtkMediaPlayerMedi
void set_media_player_attributes(GtkWidget * widget)
{
@ -67,6 +69,24 @@ Fix problem with seeking in the tracker
return FALSE;
}
@@ -1826,7 +1840,7 @@ gboolean window_key_callback(GtkWidget * widget, GdkEv
gmtk_media_player_set_attribute_integer_delta(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SATURATION, 5);
return FALSE;
case GDK_bracketleft:
- gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 0.90);
+ gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 0.9091);
return FALSE;
case GDK_bracketright:
gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 1.10);
@@ -1838,7 +1852,7 @@ gboolean window_key_callback(GtkWidget * widget, GdkEv
gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 2.0);
return FALSE;
case GDK_BackSpace:
- gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_MULTIPLIER, 1.0);
+ gmtk_media_player_set_attribute_double(GMTK_MEDIA_PLAYER(media), ATTRIBUTE_SPEED_SET, 1.0);
return FALSE;
case GDK_9:
#ifdef GTK2_12_ENABLED
@@ -1908,6 +1922,10 @@ gboolean window_key_callback(GtkWidget * widget, GdkEv
delete_callback(NULL, NULL, NULL);
}

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_libgmtk_gmtk_media_player_c,v 1.4 2011/09/29 11:03:19 dcoppa Exp $
$OpenBSD: patch-src_libgmtk_gmtk_media_player_c,v 1.5 2011/10/17 13:50:34 dcoppa Exp $
Raise event on incomplete QuickTime file, and mark it for retry
(fix apple.com/trailers) - upstream svn revision r2152
@ -16,8 +16,14 @@ When mplayer reports that it has video, resize the media
window so that mplayer has something to draw to
(upstream svn revision r46 of gmtk)
Fix speed multipliers and speed reset (upstream svn revisions r54
and r55 of gmtk)
Fix potential segfaults in gmtk_media_player when defining a specific
font (upstream svn revisions r53 and r56 of gmtk)
--- src/libgmtk/gmtk_media_player.c.orig Tue Jun 28 18:19:18 2011
+++ src/libgmtk/gmtk_media_player.c Wed Sep 28 14:54:04 2011
+++ src/libgmtk/gmtk_media_player.c Mon Oct 17 14:40:06 2011
@@ -69,15 +69,22 @@ gboolean signal_event(gpointer data)
if (event && event->event_name != NULL
@ -124,7 +130,34 @@ window so that mplayer has something to draw to
default:
if (player->debug)
printf("Unsupported Attribute\n");
@@ -1779,6 +1814,9 @@ gpointer launch_mplayer(gpointer data)
@@ -1029,12 +1064,25 @@ void gmtk_media_player_set_attribute_double(GmtkMediaP
case ATTRIBUTE_SPEED_MULTIPLIER:
player->speed_multiplier = CLAMP(value, 0.1, 10.0);
if (player->player_state == PLAYER_STATE_RUNNING) {
- cmd = g_strdup_printf("speed_mult %f\n", player->speed_multiplier);
+ if (player->speed_multiplier == 1.0) {
+ cmd = g_strdup_printf("speed_set %f\n", player->speed_multiplier);
+ } else {
+ cmd = g_strdup_printf("speed_mult %f\n", player->speed_multiplier);
+ }
write_to_mplayer(player, cmd);
g_free(cmd);
}
break;
+ case ATTRIBUTE_SPEED_SET:
+ player->speed_multiplier = CLAMP(value, 0.1, 10.0);
+ if (player->player_state == PLAYER_STATE_RUNNING) {
+ cmd = g_strdup_printf("speed_set %f\n", player->speed_multiplier);
+ write_to_mplayer(player, cmd);
+ g_free(cmd);
+ }
+ break;
+
case ATTRIBUTE_SUBTITLE_SCALE:
player->subtitle_scale = CLAMP(value, 0.2, 100.0);
if (player->player_state == PLAYER_STATE_RUNNING) {
@@ -1779,6 +1827,9 @@ gpointer launch_mplayer(gpointer data)
GList *list;
GmtkMediaPlayerSubtitle *subtitle;
GmtkMediaPlayerAudioTrack *track;
@ -134,7 +167,7 @@ window so that mplayer has something to draw to
player->seekable = FALSE;
player->has_chapters = FALSE;
@@ -1788,6 +1826,7 @@ gpointer launch_mplayer(gpointer data)
@@ -1788,6 +1839,7 @@ gpointer launch_mplayer(gpointer data)
player->title_is_menu = FALSE;
player->enable_divx = TRUE;
player->disable_xvmc = FALSE;
@ -142,7 +175,7 @@ window so that mplayer has something to draw to
g_mutex_lock(player->thread_running);
@@ -1818,7 +1857,17 @@ gpointer launch_mplayer(gpointer data)
@@ -1818,7 +1870,17 @@ gpointer launch_mplayer(gpointer data)
argn = 0;
player->playback_error = NO_ERROR;
if (player->uri != NULL) {
@ -160,7 +193,7 @@ window so that mplayer has something to draw to
}
player->minimum_mplayer = detect_mplayer_features(player);
@@ -1976,8 +2025,11 @@ gpointer launch_mplayer(gpointer data)
@@ -1976,8 +2038,11 @@ gpointer launch_mplayer(gpointer data)
argv[argn++] = g_strdup_printf("-sub-fuzziness");
argv[argn++] = g_strdup_printf("%i", player->subtitle_fuzziness);
@ -173,7 +206,27 @@ window so that mplayer has something to draw to
argv[argn++] = g_strdup_printf("-wid");
argv[argn++] = g_strdup_printf("0x%x", player->socket_id);
@@ -2477,6 +2529,11 @@ gboolean thread_reader_error(GIOChannel * source, GIOC
@@ -2027,7 +2092,8 @@ gpointer launch_mplayer(gpointer data)
if (player->subtitle_font != NULL && strlen(player->subtitle_font) > 0) {
fontname = g_strdup(player->subtitle_font);
size = g_strrstr(fontname, " ");
- size[0] = '\0';
+ if (size)
+ size[0] = '\0';
size = g_strrstr(fontname, " Bold");
if (size)
size[0] = '\0';
@@ -2063,7 +2129,8 @@ gpointer launch_mplayer(gpointer data)
if (player->subtitle_font != NULL && strlen(player->subtitle_font) > 0) {
fontname = g_strdup(player->subtitle_font);
size = g_strrstr(fontname, " ");
- size[0] = '\0';
+ if (size)
+ size[0] = '\0';
argv[argn++] = g_strdup_printf("-subfont");
argv[argn++] = g_strdup_printf("%s", fontname);
g_free(fontname);
@@ -2477,6 +2544,11 @@ gboolean thread_reader_error(GIOChannel * source, GIOC
error_msg = g_strdup_printf(_("Compressed SWF format not supported"));
}
@ -185,7 +238,7 @@ window so that mplayer has something to draw to
if (strstr(mplayer_output->str, "Title: ") != 0) {
buf = strstr(mplayer_output->str, "Title:");
buf = strstr(mplayer_output->str, "Title: ") + strlen("Title: ");
@@ -2875,6 +2932,13 @@ gboolean thread_reader(GIOChannel * source, GIOConditi
@@ -2875,6 +2947,13 @@ gboolean thread_reader(GIOChannel * source, GIOConditi
}
player->video_format = g_strdup(buf);
create_event_int(player, "attribute-changed", ATTRIBUTE_VIDEO_FORMAT);

View File

@ -1,21 +1,25 @@
$OpenBSD: patch-src_libgmtk_gmtk_media_player_h,v 1.2 2011/09/21 13:10:36 dcoppa Exp $
$OpenBSD: patch-src_libgmtk_gmtk_media_player_h,v 1.3 2011/10/17 13:50:34 dcoppa Exp $
Raise event on incomplete QuickTime file, and mark it for retry
(fix apple.com/trailers) - upstream svn revision r2152
Fix speed multipliers and speed reset (upstream svn revisions r54
and r55 of gmtk)
--- src/libgmtk/gmtk_media_player.h.orig Tue Jun 28 15:29:18 2011
+++ src/libgmtk/gmtk_media_player.h Wed Sep 21 14:48:22 2011
@@ -170,7 +170,8 @@ typedef enum {
+++ src/libgmtk/gmtk_media_player.h Mon Oct 17 14:43:23 2011
@@ -170,7 +170,9 @@ typedef enum {
ATTRIBUTE_ENABLE_FRAME_DROP,
ATTRIBUTE_TITLE,
ATTRIBUTE_ARTIST,
- ATTRIBUTE_ALBUM
+ ATTRIBUTE_ALBUM,
+ ATTRIBUTE_RETRY_ON_FULL_CACHE
+ ATTRIBUTE_RETRY_ON_FULL_CACHE,
+ ATTRIBUTE_SPEED_SET
} GmtkMediaPlayerMediaAttributes;
typedef enum {
@@ -201,6 +202,13 @@ typedef enum {
@@ -201,6 +203,13 @@ typedef enum {
COMMAND_SWITCH_FRAME_DROP
} GmtkMediaPlayerCommand;
@ -29,7 +33,7 @@ Raise event on incomplete QuickTime file, and mark it for retry
typedef struct _GmtkMediaPlayer GmtkMediaPlayer;
typedef struct _GmtkMediaPlayerClass GmtkMediaPlayerClass;
@@ -222,9 +230,11 @@ typedef struct _GmtkMediaPlayerAudioTrack {
@@ -222,9 +231,11 @@ typedef struct _GmtkMediaPlayerAudioTrack {
typedef struct _GmtkMediaPlayerEvent {
GmtkMediaPlayer *player;
@ -41,7 +45,7 @@ Raise event on incomplete QuickTime file, and mark it for retry
GtkAllocation *event_allocation;
} GmtkMediaPlayerEvent;
@@ -304,6 +314,7 @@ struct _GmtkMediaPlayer {
@@ -304,6 +315,7 @@ struct _GmtkMediaPlayer {
gchar *album;
gboolean enable_divx;
gboolean disable_xvmc;