summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-03 05:55:02 +0200
committerwm4 <wm4@nowhere>2012-08-03 05:55:02 +0200
commitb4d9647d189a6bb924fc6b415ae18969885f11f1 (patch)
treef794e727435ef230f52dd1fac7c0f7029dc7b083 /mplayer.c
parent11648493db7db164aa8fe01751b7e5c5e5faa810 (diff)
downloadmpv-b4d9647d189a6bb924fc6b415ae18969885f11f1.tar.bz2
mpv-b4d9647d189a6bb924fc6b415ae18969885f11f1.tar.xz
mplayer: do not create X11 state in player frontend
This is about the vo_x11_init_state() call. It basically opens a X11 connection. It's called in the main() function once. It's not really clear why this isn't done on VO creation instead. Maybe one reason was that --no-fixed-vo used to be the default: when playing a new file, the full VO state would be free'd and recreated. Keeping the X11 connection possibly improved things, although the question is how. In summary, there is no good reason to do this, and it only adds platform specific details to the player frontend. Do the X11 initialization in the respective VOs instead.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/mplayer.c b/mplayer.c
index a133bfb6c5..3b53e9301e 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -669,9 +669,6 @@ void exit_player_with_rc(struct MPContext *mpctx, enum exit_reason how, int rc)
#if defined(__MINGW32__) || defined(__CYGWIN__)
timeEndPeriod(1);
#endif
-#ifdef CONFIG_X11
- vo_uninit(mpctx->x11_state); // Close the X11 connection (if any is open).
-#endif
mp_input_uninit(mpctx->input);
@@ -2277,8 +2274,7 @@ int reinit_video_chain(struct MPContext *mpctx)
if (!opts->fixed_vo || !(mpctx->initialized_flags & INITIALIZED_VO)) {
//shouldn't we set dvideo->id=-2 when we fail?
//if((mpctx->video_out->preinit(vo_subdevice))!=0){
- if (!(mpctx->video_out = init_best_video_out(opts, mpctx->x11_state,
- mpctx->key_fifo,
+ if (!(mpctx->video_out = init_best_video_out(opts, mpctx->key_fifo,
mpctx->input))) {
mp_tmsg(MSGT_CPLAYER, MSGL_FATAL, "Error opening/initializing "
"the selected video_out (-vo) device.\n");
@@ -3059,8 +3055,8 @@ static void run_playloop(struct MPContext *mpctx)
vo_check_events(vo);
#ifdef CONFIG_X11
- if (stop_xscreensaver) {
- xscreensaver_heartbeat(mpctx->x11_state);
+ if (stop_xscreensaver && vo->x11) {
+ xscreensaver_heartbeat(vo->x11);
}
#endif
if (heartbeat_cmd) {
@@ -3500,9 +3496,6 @@ int main(int argc, char *argv[])
init_libav();
screenshot_init(mpctx);
-#ifdef CONFIG_X11
- mpctx->x11_state = vo_x11_init_state();
-#endif
struct MPOpts *opts = &mpctx->opts;
set_default_mplayer_options(opts);
// Create the config context and register the options