From 6bb37546483d236848dbe3dd11a601409e158e85 Mon Sep 17 00:00:00 2001 From: Damien Fouilleul Date: Thu, 26 Apr 2007 15:51:03 +0000 Subject: [PATCH] - configuration: added "--prefer-system-codecs" option to force VLC to use codecs installed on system whwn a choice is available (currently only works on win32) --- src/libvlc-common.c | 17 +++++++++++++++++ src/libvlc-module.c | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/src/libvlc-common.c b/src/libvlc-common.c index 5e02e795c9..00670a15a4 100644 --- a/src/libvlc-common.c +++ b/src/libvlc-common.c @@ -906,6 +906,23 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, char *ppsz_argv[] ) VLC_AddIntf( 0, "netsync,none", VLC_FALSE, VLC_FALSE ); } +#ifdef WIN32 + if( config_GetInt( p_libvlc, "prefer-system-codecs") == 1 ) + { + char *psz_codecs = config_GetPsz( p_playlist, "codec" ); + if( psz_codecs ) + { + char *psz_morecodecs; + asprintf(&psz_morecodecs, "%s,dmo,quicktime", psz_codecs); + if( psz_morecodecs ) + config_PutPsz( p_libvlc, "codec", psz_morecodecs); + } + else + config_PutPsz( p_libvlc, "codec", "dmo,quicktime"); + free(psz_codecs); + } +#endif + /* * FIXME: kludge to use a p_libvlc-local variable for the Mozilla plugin */ diff --git a/src/libvlc-module.c b/src/libvlc-module.c index e28c3c4414..5b80012bd8 100644 --- a/src/libvlc-module.c +++ b/src/libvlc-module.c @@ -692,6 +692,11 @@ static const char *ppsz_clock_descriptions[] = "This allows you to select a list of encoders that VLC will use in " \ "priority.") +#define SYSTEM_CODEC_TEXT N_("Prefer system plugins over vlc") +#define SYSTEM_CODEC_LONGTEXT N_( \ + "Indicates whether VLC will prefer native plugins installed " \ + "on system over VLC owns plugins whenever a choice is available." ) + /***************************************************************************** * Sout ****************************************************************************/ @@ -1405,6 +1410,9 @@ vlc_module_begin(); set_category( CAT_INPUT ); set_subcategory( SUBCAT_INPUT_GENERAL ); + add_bool( "prefer-system-codecs", VLC_FALSE, NULL, SYSTEM_CODEC_TEXT, + SYSTEM_CODEC_LONGTEXT, VLC_FALSE ); + add_bool( "france", VLC_FALSE, NULL, N_("France"), FRANCE_LONGTEXT, VLC_TRUE ); set_section( N_( "Track settings" ), NULL ); -- 2.39.2