Commit 19700693 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

DShow: fix configure dialog probe

(cherry picked from commit a6110fb1d253146810bbe5f9b5ba0097b72b4e3c)
(cherry picked from commit b24fc9a9680a2e62d1a3f660a7c20f5c9ba5cdb2)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent dfd5ae96
...@@ -2001,20 +2001,25 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name, ...@@ -2001,20 +2001,25 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
{ {
module_config_t *p_item; module_config_t *p_item;
bool b_audio = false; bool b_audio = false;
char *psz_device = NULL;
if( !EMPTY_STR( newval.psz_string ) )
psz_device = strdup( newval.psz_string );
/* Initialize OLE/COM */ /* Initialize OLE/COM */
CoInitialize( 0 ); CoInitialize( 0 );
p_item = config_FindConfig( p_this, psz_name ); p_item = config_FindConfig( p_this, psz_name );
if( !p_item ) return VLC_SUCCESS; if( !p_item ) return VLC_SUCCESS;
if( !strcmp( psz_name, "dshow-adev" ) ) b_audio = true; if( !strcmp( psz_name, "dshow-adev" ) ) b_audio = true;
string devicename; string devicename;
if( newval.psz_string && *newval.psz_string ) if( psz_device )
{ {
devicename = newval.psz_string; devicename = psz_device ;
} }
else else
{ {
...@@ -2040,12 +2045,14 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name, ...@@ -2040,12 +2045,14 @@ static int ConfigDevicesCallback( vlc_object_t *p_this, char const *psz_name,
CoUninitialize(); CoUninitialize();
msg_Err( p_this, "didn't find device: %s", devicename.c_str() ); msg_Err( p_this, "didn't find device: %s", devicename.c_str() );
free( psz_device );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* Uninitialize OLE/COM */ /* Uninitialize OLE/COM */
CoUninitialize(); CoUninitialize();
free( psz_device );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment