# HG changeset patch # User ben # Date 1200007970 0 # Node ID 58fd8ebcd6e31e72b988a16dcafbb615265ac25d # Parent a51e1bd9ba4f0e31e3f187308fe210cb1e6c98f3 allow profile loading per audio/video output diff -r a51e1bd9ba4f -r 58fd8ebcd6e3 mplayer.c --- a/mplayer.c Thu Jan 10 21:47:33 2008 +0000 +++ b/mplayer.c Thu Jan 10 23:32:50 2008 +0000 @@ -882,6 +882,23 @@ } } +#define PROFILE_CFG_VO "vo." +#define PROFILE_CFG_AO "ao." + +static void load_per_output_config (m_config_t* conf, char *cfg, char *out) +{ + char profile[strlen (cfg) + strlen (out) + 1]; + m_profile_t *p; + + sprintf (profile, "%s%s", cfg, out); + p = m_config_get_profile (conf, profile); + if (p) + { + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_LoadingExtensionProfile, profile); + m_config_set_profile(conf,p); + } +} + static void load_per_file_config (m_config_t* conf, const char *const file) { char *confpath; @@ -2747,6 +2764,11 @@ load_per_file_config (mconfig, filename); } + if (video_driver_list) + load_per_output_config (mconfig, PROFILE_CFG_VO, video_driver_list[0]); + if (audio_driver_list) + load_per_output_config (mconfig, PROFILE_CFG_AO, audio_driver_list[0]); + // We must enable getch2 here to be able to interrupt network connection // or cache filling if(!noconsolecontrols && !slave_mode){