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
4 Author: Bilal Akhtar <bilalakhtar96@yahoo.com>
6 --- a/src/vlc_engine.cc
7 +++ b/src/vlc_engine.cc
12 - libvlc_exception_init (&exception);
15 const char * vlc_argv[50];
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);
26 + instance = libvlc_new (i, vlc_argv);
28 - libvlc_audio_set_volume(instance, DEFAULT_VOLUME, &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);
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");
42 g_debug("VLC engine destroyed");
45 -void VlcEngine::check_exception(const Glib::ustring& message)
47 - if (libvlc_exception_raised(&exception))
50 - Glib::ustring exception_message = libvlc_exception_get_message(&exception);
52 - if (message.empty())
54 - text = exception_message;
58 - text = Glib::ustring::compose("%1: %2", message, exception_message);
61 - throw Exception(text);
65 void VlcEngine::set_window(int window)
67 - libvlc_media_player_set_xwindow(media_player, window, &exception);
69 + libvlc_media_player_set_xwindow(media_player, window);
72 void VlcEngine::pause(gboolean state)
77 - libvlc_media_player_pause(media_player, &exception);
78 + libvlc_media_player_pause(media_player);
82 - libvlc_media_player_play(media_player, &exception);
83 + libvlc_media_player_play(media_player);
93 - libvlc_media_player_play(media_player, &exception);
95 + libvlc_media_player_play(media_player);
103 - libvlc_media_t* media = libvlc_media_player_get_media(media_player, &exception);
106 - libvlc_media_player_stop(media_player, &exception);
109 - libvlc_media_player_set_media(media_player, NULL, &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);
124 - libvlc_media_t* media = libvlc_media_new(instance, mrl.c_str(), &exception);
127 - libvlc_media_player_set_media(media_player, media, &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 @@
139 - libvlc_media_player_set_time(media_player, new_time, &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);
150 + libvlc_media_t* media = libvlc_media_player_get_media(media_player);
151 return media != NULL;
154 @@ -225,11 +182,10 @@
158 - result = libvlc_media_player_get_time(media_player, &exception);
160 + result = libvlc_media_player_get_time(media_player);
167 int VlcEngine::get_length()
168 @@ -238,11 +194,10 @@
172 - result = libvlc_media_player_get_length(media_player, &exception);
174 + result = libvlc_media_player_get_length(media_player);
181 float VlcEngine::get_percentage()
186 - result = libvlc_media_player_get_position(media_player, &exception);
188 + result = libvlc_media_player_get_position(media_player);
192 @@ -262,30 +216,19 @@
196 - libvlc_media_player_set_position(media_player, percentage, &exception);
198 + libvlc_media_player_set_position(media_player, percentage);
202 void VlcEngine::set_volume(double value)
206 -libvlc_audio_set_volume(instance, value, &exception);
211 + libvlc_audio_set_volume(media_player, value);
215 double VlcEngine::get_volume()
219 -int returnn=libvlc_audio_get_volume(instance,&exception);
227 + return has_media() ? libvlc_audio_get_volume(media_player) : 0;
229 --- a/src/vlc_engine.h
230 +++ b/src/vlc_engine.h
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 = "");
241 VlcEngine(bool use_ffmpeg_demux = false);