aboutsummaryrefslogtreecommitdiff
path: root/multimedia/gnome-mplayer/gnome-mplayer-fixes.diff
blob: fab0415eefb1bb1269346d37385325d2b5d30f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
diff -ru gnome-mplayer-1.0.4-orig/ChangeLog gnome-mplayer-1.0.4/ChangeLog
--- gnome-mplayer-1.0.4-orig/ChangeLog	2011-07-01 12:37:25.000000000 -0400
+++ gnome-mplayer-1.0.4/ChangeLog	2011-07-09 21:02:50.000000000 -0400
@@ -1,3 +1,6 @@
+Development
+    Raise event on incomplete QuickTime file, and mark it for retry
+    Fix compile issue with alsa is not being used
 1.0.4
     Remove vdpau failure detection as it doesn't work
     Quit mplayer on vdpau restart, mplayer doesn't want to die
diff -ru gnome-mplayer-1.0.4-orig/src/gui.c gnome-mplayer-1.0.4/src/gui.c
--- gnome-mplayer-1.0.4-orig/src/gui.c	2011-06-27 10:59:45.000000000 -0400
+++ gnome-mplayer-1.0.4/src/gui.c	2011-07-09 21:04:12.000000000 -0400
@@ -5073,7 +5073,7 @@
     gtk_spin_button_set_value(GTK_SPIN_BUTTON(config_volume), gm_pref_store_get_int(gm_store, VOLUME));
     gm_pref_store_free(gm_store);
     gtk_entry_set_width_chars(GTK_ENTRY(config_volume), 6);
-    gtk_entry_set_editable(GTK_ENTRY(config_volume), FALSE);
+    gtk_editable_set_editable(GTK_EDITABLE(config_volume), FALSE);
     gtk_entry_set_alignment(GTK_ENTRY(config_volume), 1);
     gtk_widget_show(config_volume);
     i++;
@@ -6052,6 +6052,11 @@
         g_strlcpy(idledata->media_info, text, 1024);
         g_thread_create(get_cover_art, metadata, FALSE, NULL);
         break;
+
+	case ATTRIBUTE_RETRY_ON_FULL_CACHE:
+		idledata->retry_on_full_cache = gmtk_media_player_get_attribute_boolean (GMTK_MEDIA_PLAYER(media), ATTRIBUTE_RETRY_ON_FULL_CACHE);
+		break;		
+			
     default:
         if (verbose) {
             printf("Unhandled attribute change %i\n", attribute);
diff -ru gnome-mplayer-1.0.4-orig/src/libgmtk/gmtk_media_player.c gnome-mplayer-1.0.4/src/libgmtk/gmtk_media_player.c
--- gnome-mplayer-1.0.4-orig/src/libgmtk/gmtk_media_player.c	2011-06-28 12:19:18.000000000 -0400
+++ gnome-mplayer-1.0.4/src/libgmtk/gmtk_media_player.c	2011-07-09 21:04:50.000000000 -0400
@@ -69,15 +69,27 @@
 
     if (event && event->event_name != NULL 
         && (event->player->restart == FALSE || event->event_data_int == ATTRIBUTE_AF_EXPORT_FILENAME)) {
-        if (g_strcasecmp(event->event_name, "position-changed") == 0 ||
-            g_strcasecmp(event->event_name, "cache-percent-changed") == 0) {
-            g_signal_emit_by_name(event->player, event->event_name, event->event_data_double);
-        } else if (g_strcasecmp(event->event_name, "size_allocate") == 0) {
-            g_signal_emit_by_name(event->player, event->event_name, event->event_allocation);
-        } else {
-            g_signal_emit_by_name(event->player, event->event_name, event->event_data_int);
-        }
 
+		switch (event->type) {
+			case EVENT_TYPE_INT:
+	            g_signal_emit_by_name(event->player, event->event_name, event->event_data_int);
+				break;
+
+			case EVENT_TYPE_DOUBLE:
+	            g_signal_emit_by_name(event->player, event->event_name, event->event_data_double);
+				break;
+
+			case EVENT_TYPE_BOOLEAN:
+	            g_signal_emit_by_name(event->player, event->event_name, event->event_data_boolean);
+				break;
+				
+			case EVENT_TYPE_ALLOCATION:
+    		    g_signal_emit_by_name(event->player, event->event_name, event->event_allocation);
+				break;
+				
+			default:
+				printf("undefined event %s\n", event->event_name);
+		}
         g_free(event->event_name);
     }
     if (event)
@@ -93,6 +105,7 @@
 
     event = g_new0(GmtkMediaPlayerEvent, 1);
     event->player = player;
+	event->type = EVENT_TYPE_INT;
     event->event_name = g_strdup(name);
     event->event_data_int = value;
     g_idle_add(signal_event, event);
@@ -104,17 +117,31 @@
 
     event = g_new0(GmtkMediaPlayerEvent, 1);
     event->player = player;
+	event->type = EVENT_TYPE_DOUBLE;
     event->event_name = g_strdup(name);
     event->event_data_double = value;
     g_idle_add(signal_event, event);
 }
 
+void create_event_boolean(GmtkMediaPlayer * player, const gchar * name, gboolean value)
+{
+    GmtkMediaPlayerEvent *event;
+
+    event = g_new0(GmtkMediaPlayerEvent, 1);
+    event->player = player;
+	event->type = EVENT_TYPE_BOOLEAN;
+    event->event_name = g_strdup(name);
+    event->event_data_boolean = value;
+    g_idle_add(signal_event, event);
+}
+
 void create_event_allocation(GmtkMediaPlayer * player, const gchar * name, GtkAllocation * allocation)
 {
     GmtkMediaPlayerEvent *event;
 
     event = g_new0(GmtkMediaPlayerEvent, 1);
     event->player = player;
+	event->type = EVENT_TYPE_ALLOCATION;
     event->event_name = g_strdup(name);
     event->event_allocation = allocation;
     g_idle_add(signal_event, event);
@@ -300,6 +327,7 @@
     player->channel_in = NULL;
     player->channel_out = NULL;
     player->channel_err = NULL;
+	player->retry_on_full_cache = FALSE;
 }
 
 static void gmtk_media_player_dispose(GObject * object)
@@ -993,6 +1021,10 @@
         ret = player->hardware_ac3;
         break;
 
+	case ATTRIBUTE_RETRY_ON_FULL_CACHE:
+		ret = player->retry_on_full_cache;
+		break;
+			
     default:
         if (player->debug)
             printf("Unsupported Attribute\n");
@@ -1788,6 +1820,7 @@
     player->title_is_menu = FALSE;
     player->enable_divx = TRUE;
     player->disable_xvmc = FALSE;
+	player->retry_on_full_cache = FALSE;
 
     g_mutex_lock(player->thread_running);
 
@@ -2477,6 +2510,11 @@
         error_msg = g_strdup_printf(_("Compressed SWF format not supported"));
     }
 
+	if (strstr(mplayer_output->str, "MOV: missing header (moov/cmov) chunk") != NULL) {
+        player->retry_on_full_cache = TRUE;
+		create_event_boolean(player, "attribute-changed", ATTRIBUTE_RETRY_ON_FULL_CACHE);
+    }
+	
     if (strstr(mplayer_output->str, "Title: ") != 0) {
         buf = strstr(mplayer_output->str, "Title:");
         buf = strstr(mplayer_output->str, "Title: ") + strlen("Title: ");
diff -ru gnome-mplayer-1.0.4-orig/src/libgmtk/gmtk_media_player.h gnome-mplayer-1.0.4/src/libgmtk/gmtk_media_player.h
--- gnome-mplayer-1.0.4-orig/src/libgmtk/gmtk_media_player.h	2011-06-28 09:29:18.000000000 -0400
+++ gnome-mplayer-1.0.4/src/libgmtk/gmtk_media_player.h	2011-07-09 21:04:50.000000000 -0400
@@ -170,7 +170,8 @@
     ATTRIBUTE_ENABLE_FRAME_DROP,
     ATTRIBUTE_TITLE,
     ATTRIBUTE_ARTIST,
-    ATTRIBUTE_ALBUM
+    ATTRIBUTE_ALBUM,
+	ATTRIBUTE_RETRY_ON_FULL_CACHE
 } GmtkMediaPlayerMediaAttributes;
 
 typedef enum {
@@ -201,6 +202,13 @@
     COMMAND_SWITCH_FRAME_DROP
 } GmtkMediaPlayerCommand;
 
+typedef enum {
+	EVENT_TYPE_INT,
+	EVENT_TYPE_DOUBLE,
+	EVENT_TYPE_BOOLEAN,
+	EVENT_TYPE_ALLOCATION
+} GmtkMediaPlayerEventType;
+
 typedef struct _GmtkMediaPlayer GmtkMediaPlayer;
 typedef struct _GmtkMediaPlayerClass GmtkMediaPlayerClass;
 
@@ -222,9 +230,11 @@
 
 typedef struct _GmtkMediaPlayerEvent {
     GmtkMediaPlayer *player;
+	GmtkMediaPlayerEventType type;
     gchar *event_name;
     gint event_data_int;
     gdouble event_data_double;
+	gboolean event_data_boolean;
     GtkAllocation *event_allocation;
 } GmtkMediaPlayerEvent;
 
@@ -304,6 +314,7 @@
     gchar *album;
     gboolean enable_divx;
     gboolean disable_xvmc;
+	gboolean retry_on_full_cache;
 
     gboolean deinterlace;
     gboolean frame_drop;
diff -ru gnome-mplayer-1.0.4-orig/src/main.c gnome-mplayer-1.0.4/src/main.c
--- gnome-mplayer-1.0.4-orig/src/main.c	2011-06-27 10:59:45.000000000 -0400
+++ gnome-mplayer-1.0.4/src/main.c	2011-07-09 21:04:12.000000000 -0400
@@ -534,6 +534,7 @@
     idledata->width = width;
     idledata->height = height;
 
+	idledata->retry_on_full_cache = FALSE;
     idledata->cachepercent = -1.0;
     g_strlcpy(idledata->info, uri, 1024);
     set_media_info(idledata);