Monitor subtitle visibility better

From upstream svn
This commit is contained in:
dcoppa 2012-05-09 14:19:36 +00:00
parent 4001191856
commit ffee4301e4
4 changed files with 73 additions and 23 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.8 2012/05/03 15:18:50 dcoppa Exp $
# $OpenBSD: Makefile,v 1.9 2012/05/09 14:19:36 dcoppa Exp $
COMMENT = gnome-mplayer toolkit
DISTNAME = gmtk-1.0.6
REVISION = 0
REVISION = 1
SHARED_LIBS = gmlib 0.0 \
gmtk 0.0

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_gmtk_media_player_c,v 1.6 2012/05/03 15:18:50 dcoppa Exp $
$OpenBSD: patch-src_gmtk_media_player_c,v 1.7 2012/05/09 14:19:37 dcoppa Exp $
Set black background color for all GTK states on media widget
(upstream svn revision r105)
@ -9,6 +9,9 @@ or incorrect (upstream svn revision r109)
Protect against possible divide by zero in gmtk_media_player_size_allocate
(upstream svn revision r111)
Monitor subtitle visibility better
(upstream svn revision r112)
Fix logic error in ERROR_RETRY
(upstream svn revision r107)
@ -19,7 +22,7 @@ Replace deprecated g_strncasecmp with g_ascii_strncasecmp
(upstream svn revision r106)
--- src/gmtk_media_player.c.orig Fri Apr 6 15:19:32 2012
+++ src/gmtk_media_player.c Thu May 3 14:25:30 2012
+++ src/gmtk_media_player.c Wed May 9 15:26:51 2012
@@ -56,6 +56,11 @@ static void socket_realized(GtkWidget * widget, gpoint
player->socket_id = GPOINTER_TO_INT(gtk_socket_get_id(GTK_SOCKET(widget)));
style = gtk_widget_get_style(GTK_WIDGET(player));
@ -48,7 +51,18 @@ Replace deprecated g_strncasecmp with g_ascii_strncasecmp
if (player->video_width == 0 || player->video_height == 0 || !gmtk_widget_get_realized(widget)) {
gtk_alignment_set(GTK_ALIGNMENT(player->alignment), 0.0, 0.0, 1.0, 1.0);
} else {
@@ -2578,10 +2592,10 @@ gpointer launch_mplayer(gpointer data)
@@ -1018,9 +1032,7 @@ gboolean gmtk_media_player_get_attribute_boolean(GmtkM
switch (attribute) {
case ATTRIBUTE_SUB_VISIBLE:
- if (g_list_length(player->subtitles) != 0) {
- ret = player->sub_visible;
- }
+ ret = player->sub_visible;
break;
case ATTRIBUTE_ENABLE_FRAME_DROP:
@@ -2578,10 +2590,10 @@ gpointer launch_mplayer(gpointer data)
break;
case ERROR_RETRY:
if (last_error == NO_ERROR) {
@ -62,7 +76,7 @@ Replace deprecated g_strncasecmp with g_ascii_strncasecmp
}
break;
@@ -2679,10 +2693,18 @@ gboolean thread_reader_error(GIOChannel * source, GIOC
@@ -2679,10 +2691,18 @@ gboolean thread_reader_error(GIOChannel * source, GIOC
if (player->position == 0) {
player->playback_error = ERROR_RETRY;
}
@ -81,7 +95,30 @@ Replace deprecated g_strncasecmp with g_ascii_strncasecmp
if (strstr(mplayer_output->str, "Failed creating VDPAU decoder") != NULL) {
if (player->enable_divx && (g_ascii_strncasecmp(player->vo, "vdpau", strlen("vdpau")) == 0))
@@ -3463,6 +3485,12 @@ gboolean thread_reader(GIOChannel * source, GIOConditi
@@ -2886,6 +2906,7 @@ gboolean thread_reader(GIOChannel * source, GIOConditi
create_event_allocation(player, "size_allocate", &allocation);
player->video_present = TRUE;
write_to_mplayer(player, "get_property sub_source\n");
+ write_to_mplayer(player, "get_property sub_visibility\n");
create_event_int(player, "attribute-changed", ATTRIBUTE_SIZE);
create_event_int(player, "attribute-changed", ATTRIBUTE_VIDEO_PRESENT);
create_event_int(player, "subtitles-changed", g_list_length(player->subtitles));
@@ -2993,6 +3014,14 @@ gboolean thread_reader(GIOChannel * source, GIOConditi
create_event_int(player, "attribute-changed", ATTRIBUTE_SUBTITLE);
}
+ if (strstr(mplayer_output->str, "ANS_sub_visibility") != 0) {
+ if (strstr(mplayer_output->str, "ANS_sub_visibility=yes") != 0) {
+ player->sub_visible = TRUE;
+ } else {
+ player->sub_visible = FALSE;
+ }
+ create_event_int(player, "attribute-changed", ATTRIBUTE_SUB_VISIBLE);
+ }
if (strstr(mplayer_output->str, "DVDNAV_TITLE_IS_MENU") != 0) {
player->title_is_menu = TRUE;
@@ -3463,6 +3492,12 @@ gboolean thread_reader(GIOChannel * source, GIOConditi
message = NULL;
}
@ -94,7 +131,7 @@ Replace deprecated g_strncasecmp with g_ascii_strncasecmp
}
g_string_free(mplayer_output, TRUE);
@@ -3521,7 +3549,7 @@ gboolean write_to_mplayer(GmtkMediaPlayer * player, co
@@ -3521,7 +3556,7 @@ gboolean write_to_mplayer(GmtkMediaPlayer * player, co
if (player->use_mplayer2) {
pkf_cmd = g_strdup(cmd);
} else {

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.60 2012/05/03 15:19:08 dcoppa Exp $
# $OpenBSD: Makefile,v 1.61 2012/05/09 14:19:37 dcoppa Exp $
COMMENT = GTK+/GNOME frontend for MPlayer
V = 1.0.6
DISTNAME = gnome-mplayer-${V}
REVISION = 0
REVISION = 1
CATEGORIES = x11 multimedia
@ -36,7 +36,7 @@ LIB_DEPENDS = devel/libnotify>=0.7.2 \
audio/libmusicbrainz \
net/curl \
x11/dbus-glib \
x11/gmtk>=${V} \
x11/gmtk>=${V}p1 \
x11/gtk+2
RUN_DEPENDS = devel/desktop-file-utils \
x11/gnome/icon-theme \

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_gui_c,v 1.26 2012/05/03 15:19:08 dcoppa Exp $
$OpenBSD: patch-src_gui_c,v 1.27 2012/05/09 14:19:37 dcoppa Exp $
Initialize a variable to NULL
(upstream svn revision r2243)
@ -6,14 +6,17 @@ Initialize a variable to NULL
Fix a couple of keyboard shortcuts as they were in the wrong shift
state (upstream svn revision r2245)
Monitor subtitle visibility better
(upstream svn revision r2248)
Fix button sensitivity based on state
(upstream svn revision r2239)
Add mouse events to capture over the media window
(upstream svn revision r2247)
--- src/gui.c.orig Thu May 3 16:54:44 2012
+++ src/gui.c Thu May 3 16:54:53 2012
--- src/gui.c.orig Fri Apr 6 15:19:25 2012
+++ src/gui.c Wed May 9 15:40:09 2012
@@ -604,7 +604,7 @@ gboolean set_progress_value(void *data)
gchar *text;
struct stat buf = { 0 };
@ -76,7 +79,17 @@ Add mouse events to capture over the media window
default:
gmtk_media_player_send_key_press_event(GMTK_MEDIA_PLAYER(media), event, data);
return FALSE;
@@ -6358,6 +6363,10 @@ void player_media_state_changed_callback(GtkButton * b
@@ -6136,6 +6141,9 @@ void player_attribute_changed_callback(GmtkMediaTracke
gtk_widget_set_sensitive(GTK_WIDGET(menuitem_view_subtitles),
gmtk_media_player_get_attribute_boolean(GMTK_MEDIA_PLAYER(media),
ATTRIBUTE_SUBS_EXIST));
+
+ break;
+ case ATTRIBUTE_SUB_VISIBLE:
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem_view_subtitles),
gmtk_media_player_get_attribute_boolean(GMTK_MEDIA_PLAYER(media),
ATTRIBUTE_SUB_VISIBLE));
@@ -6358,6 +6366,10 @@ void player_media_state_changed_callback(GtkButton * b
#endif
gtk_widget_set_sensitive(ff_event_box, FALSE);
gtk_widget_set_sensitive(rew_event_box, FALSE);
@ -87,7 +100,7 @@ Add mouse events to capture over the media window
if (GTK_WIDGET(gtk_widget_get_parent(GTK_WIDGET(menuitem_play))) == GTK_WIDGET(popup_menu))
gtk_container_remove(GTK_CONTAINER(popup_menu), GTK_WIDGET(menuitem_play));
menuitem_play = GTK_MENU_ITEM(gtk_image_menu_item_new_from_stock(GTK_STOCK_MEDIA_PLAY, NULL));
@@ -6381,6 +6390,10 @@ void player_media_state_changed_callback(GtkButton * b
@@ -6381,6 +6393,10 @@ void player_media_state_changed_callback(GtkButton * b
#endif
gtk_widget_set_sensitive(ff_event_box, TRUE);
gtk_widget_set_sensitive(rew_event_box, TRUE);
@ -98,7 +111,7 @@ Add mouse events to capture over the media window
if (GTK_WIDGET(gtk_widget_get_parent(GTK_WIDGET(menuitem_play))) == GTK_WIDGET(popup_menu))
gtk_container_remove(GTK_CONTAINER(popup_menu), GTK_WIDGET(menuitem_play));
menuitem_play = GTK_MENU_ITEM(gtk_image_menu_item_new_from_stock(GTK_STOCK_MEDIA_PAUSE, NULL));
@@ -6404,6 +6417,10 @@ void player_media_state_changed_callback(GtkButton * b
@@ -6404,6 +6420,10 @@ void player_media_state_changed_callback(GtkButton * b
#endif
gtk_widget_set_sensitive(ff_event_box, FALSE);
gtk_widget_set_sensitive(rew_event_box, FALSE);
@ -109,7 +122,7 @@ Add mouse events to capture over the media window
if (GTK_WIDGET(gtk_widget_get_parent(GTK_WIDGET(menuitem_play))) == GTK_WIDGET(popup_menu))
gtk_container_remove(GTK_CONTAINER(popup_menu), GTK_WIDGET(menuitem_play));
menuitem_play = GTK_MENU_ITEM(gtk_image_menu_item_new_from_stock(GTK_STOCK_MEDIA_PLAY, NULL));
@@ -7257,6 +7274,9 @@ GtkWidget *create_window(gint windowid)
@@ -7257,6 +7277,9 @@ GtkWidget *create_window(gint windowid)
hbox = gtk_hbox_new(FALSE, 0);
controls_box = gtk_vbox_new(FALSE, 0);
media = gmtk_media_player_new();
@ -119,7 +132,7 @@ Add mouse events to capture over the media window
g_signal_connect_swapped(G_OBJECT(media), "media_state_changed",
G_CALLBACK(player_media_state_changed_callback), NULL);
g_signal_connect_swapped(G_OBJECT(media), "button_press_event", G_CALLBACK(popup_handler), G_OBJECT(popup_menu));
@@ -7407,6 +7427,7 @@ GtkWidget *create_window(gint windowid)
@@ -7407,6 +7430,7 @@ GtkWidget *create_window(gint windowid)
gtk_box_pack_start(GTK_BOX(hbox), prev_event_box, FALSE, FALSE, 0);
gtk_widget_show(image_prev);
gtk_widget_show(prev_event_box);
@ -127,7 +140,7 @@ Add mouse events to capture over the media window
rew_event_box = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(rew_event_box), image_rew);
@@ -7427,6 +7448,7 @@ GtkWidget *create_window(gint windowid)
@@ -7427,6 +7451,7 @@ GtkWidget *create_window(gint windowid)
gtk_box_pack_start(GTK_BOX(hbox), rew_event_box, FALSE, FALSE, 0);
gtk_widget_show(image_rew);
gtk_widget_show(rew_event_box);
@ -135,7 +148,7 @@ Add mouse events to capture over the media window
play_event_box = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(play_event_box), image_play);
@@ -7467,6 +7489,7 @@ GtkWidget *create_window(gint windowid)
@@ -7467,6 +7492,7 @@ GtkWidget *create_window(gint windowid)
gtk_box_pack_start(GTK_BOX(hbox), stop_event_box, FALSE, FALSE, 0);
gtk_widget_show(image_stop);
gtk_widget_show(stop_event_box);
@ -143,7 +156,7 @@ Add mouse events to capture over the media window
ff_event_box = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(ff_event_box), image_ff);
@@ -7487,6 +7510,7 @@ GtkWidget *create_window(gint windowid)
@@ -7487,6 +7513,7 @@ GtkWidget *create_window(gint windowid)
gtk_box_pack_start(GTK_BOX(hbox), ff_event_box, FALSE, FALSE, 0);
gtk_widget_show(image_ff);
gtk_widget_show(ff_event_box);
@ -151,7 +164,7 @@ Add mouse events to capture over the media window
next_event_box = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(next_event_box), image_next);
@@ -7507,6 +7531,8 @@ GtkWidget *create_window(gint windowid)
@@ -7507,6 +7534,8 @@ GtkWidget *create_window(gint windowid)
gtk_box_pack_start(GTK_BOX(hbox), next_event_box, FALSE, FALSE, 0);
gtk_widget_show(image_next);
gtk_widget_show(next_event_box);