updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / gnome-media-player / vlc-1.1.0-upgrade.patch
blob174f23271f9e5f6d2907468ec4bbe5aabe7f3bc8
1 Description: Patch to make GNOME Media Player use vlc 1.1.0
2 This patch makes GNOME Media Player use VLC 1.1.0 to fix FTBFS in
3 Maverick.
4 Author: Bilal Akhtar <bilalakhtar96@yahoo.com>
6 --- a/src/vlc_engine.cc
7 +++ b/src/vlc_engine.cc
8 @@ -35,8 +35,6 @@
9 instance = NULL;
10 media_player = NULL;
12 - libvlc_exception_init (&exception);
14 int i = 0;
15 const char * vlc_argv[50];
17 @@ -66,18 +64,13 @@
18 g_debug("Deinterlacer disabled");
21 - instance = libvlc_new (i, vlc_argv, &exception);
22 - check_exception("To use the VLC engine you must install VLC");
24 - media_player = libvlc_media_player_new(instance, &exception);
25 - check_exception();
26 + instance = libvlc_new (i, vlc_argv);
28 - libvlc_audio_set_volume(instance, DEFAULT_VOLUME, &exception);
29 - check_exception();
30 + media_player = libvlc_media_player_new(instance);
31 + libvlc_audio_set_volume(media_player, DEFAULT_VOLUME);
33 - event_manager = libvlc_media_player_event_manager(media_player, &exception);
34 - libvlc_event_attach(event_manager, libvlc_MediaPlayerEndReached, end_reached_callback, NULL, &exception);
35 - check_exception();
36 + event_manager = libvlc_media_player_event_manager(media_player);
37 + libvlc_event_attach(event_manager, libvlc_MediaPlayerEndReached, end_reached_callback, NULL);
39 g_message("VLC engine created");
41 @@ -103,30 +96,9 @@
42 g_debug("VLC engine destroyed");
45 -void VlcEngine::check_exception(const Glib::ustring& message)
47 - if (libvlc_exception_raised(&exception))
48 - {
49 - Glib::ustring text;
50 - Glib::ustring exception_message = libvlc_exception_get_message(&exception);
52 - if (message.empty())
53 - {
54 - text = exception_message;
55 - }
56 - else
57 - {
58 - text = Glib::ustring::compose("%1: %2", message, exception_message);
59 - }
61 - throw Exception(text);
62 - }
65 void VlcEngine::set_window(int window)
67 - libvlc_media_player_set_xwindow(media_player, window, &exception);
68 - check_exception();
69 + libvlc_media_player_set_xwindow(media_player, window);
72 void VlcEngine::pause(gboolean state)
73 @@ -135,13 +107,12 @@
75 if (state)
77 - libvlc_media_player_pause(media_player, &exception);
78 + libvlc_media_player_pause(media_player);
80 else
82 - libvlc_media_player_play(media_player, &exception);
83 + libvlc_media_player_play(media_player);
85 - check_exception();
89 @@ -149,8 +120,7 @@
91 if (has_media())
93 - libvlc_media_player_play(media_player, &exception);
94 - check_exception();
95 + libvlc_media_player_play(media_player);
99 @@ -158,17 +128,10 @@
101 if (has_media())
103 - libvlc_media_t* media = libvlc_media_player_get_media(media_player, &exception);
104 - check_exception();
106 - libvlc_media_player_stop(media_player, &exception);
107 - check_exception();
109 - libvlc_media_player_set_media(media_player, NULL, &exception);
110 - check_exception();
112 + libvlc_media_t* media = libvlc_media_player_get_media(media_player);
113 + libvlc_media_player_stop(media_player);
114 + libvlc_media_player_set_media(media_player, NULL);
115 libvlc_media_release(media);
116 - check_exception();
120 @@ -181,12 +144,8 @@
122 stop();
124 - libvlc_media_t* media = libvlc_media_new(instance, mrl.c_str(), &exception);
125 - check_exception();
127 - libvlc_media_player_set_media(media_player, media, &exception);
128 - check_exception();
130 + libvlc_media_t* media = libvlc_media_new_path(instance, mrl.c_str());
131 + libvlc_media_player_set_media(media_player, media);
132 libvlc_media_release(media);
135 @@ -206,16 +165,14 @@
137 else
139 - libvlc_media_player_set_time(media_player, new_time, &exception);
140 - check_exception();
141 + libvlc_media_player_set_time(media_player, new_time);
146 bool VlcEngine::has_media()
148 - libvlc_media_t* media = libvlc_media_player_get_media(media_player, &exception);
149 - check_exception();
150 + libvlc_media_t* media = libvlc_media_player_get_media(media_player);
151 return media != NULL;
154 @@ -225,11 +182,10 @@
156 if (has_media())
158 - result = libvlc_media_player_get_time(media_player, &exception);
159 - check_exception();
160 + result = libvlc_media_player_get_time(media_player);
163 - return result;
164 + return result;
167 int VlcEngine::get_length()
168 @@ -238,11 +194,10 @@
170 if (has_media())
172 - result = libvlc_media_player_get_length(media_player, &exception);
173 - check_exception();
174 + result = libvlc_media_player_get_length(media_player);
177 - return result;
178 + return result;
181 float VlcEngine::get_percentage()
182 @@ -251,8 +206,7 @@
184 if (has_media())
186 - result = libvlc_media_player_get_position(media_player, &exception);
187 - check_exception();
188 + result = libvlc_media_player_get_position(media_player);
191 return result;
192 @@ -262,30 +216,19 @@
194 if (has_media())
196 - libvlc_media_player_set_position(media_player, percentage, &exception);
197 - check_exception();
198 + libvlc_media_player_set_position(media_player, percentage);
202 void VlcEngine::set_volume(double value)
204 -if (has_media())
206 -libvlc_audio_set_volume(instance, value, &exception);
207 -check_exception();
209 + if (has_media())
211 + libvlc_audio_set_volume(media_player, value);
215 double VlcEngine::get_volume()
217 -if (has_media())
219 -int returnn=libvlc_audio_get_volume(instance,&exception);
220 -check_exception();
221 -return returnn;
223 -else
225 -return 0;
227 + return has_media() ? libvlc_audio_get_volume(media_player) : 0;
229 --- a/src/vlc_engine.h
230 +++ b/src/vlc_engine.h
231 @@ -28,11 +28,8 @@
232 private:
233 libvlc_instance_t* instance;
234 libvlc_media_player_t* media_player;
235 - libvlc_exception_t exception;
236 libvlc_event_manager_t* event_manager;
238 - void check_exception(const Glib::ustring& message = "");
240 public:
241 VlcEngine(bool use_ffmpeg_demux = false);
242 ~VlcEngine();