X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fdshow%2Fdshow.cpp;h=128ed4963633b0292fc29d2eeb295ca90630b8e4;hb=0a549e8ef82b3e12bda93e3391dc86d9b855e2d4;hp=cfaacc1ad5bcbec63f57f28422d4d57bc701b809;hpb=3561b9b28f58eb7a4183e158a8fd973800d31ceb;p=vlc diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp index cfaacc1ad5..128ed49636 100644 --- a/modules/access/dshow/dshow.cpp +++ b/modules/access/dshow/dshow.cpp @@ -158,7 +158,20 @@ static const char *const ppsz_amtuner_mode_text[] = { N_("Default"), #define AMTUNER_MODE_TEXT N_("AM Tuner mode") #define AMTUNER_MODE_LONGTEXT N_( \ - "AM Tuner mode. Can be one of DEFAULT, TV, AM_RADIO, FM_RADIO or DSS.") + "AM Tuner mode. Can be one of Default (0), TV (1)," \ + "AM Radio (2), FM Radio (3) or DSS (4).") + +#define AUDIO_CHANNELS_TEXT N_("Number of audio channels") +#define AUDIO_CHANNELS_LONGTEXT N_( \ + "Select audio input format with the given number of audio channels (if non 0)" ) + +#define AUDIO_SAMPLERATE_TEXT N_("Audio sample rate") +#define AUDIO_SAMPLERATE_LONGTEXT N_( \ + "Select audio input format with the given sample rate (if non 0)" ) + +#define AUDIO_BITSPERSAMPLE_TEXT N_("Audio bits per sample") +#define AUDIO_BITSPERSAMPLE_LONGTEXT N_( \ + "Select audio input format with the given bits/sample (if non 0)" ) static int CommonOpen ( vlc_object_t *, access_sys_t *, bool ); static void CommonClose( vlc_object_t *, access_sys_t * ); @@ -227,6 +240,13 @@ vlc_module_begin(); AMTUNER_MODE_TEXT, AMTUNER_MODE_LONGTEXT, false); change_integer_list( pi_amtuner_mode, ppsz_amtuner_mode_text, 0 ); + add_integer( "dshow-audio-channels", 0, NULL, AUDIO_CHANNELS_TEXT, + AUDIO_CHANNELS_LONGTEXT, true ); + add_integer( "dshow-audio-samplerate", 0, NULL, AUDIO_SAMPLERATE_TEXT, + AUDIO_SAMPLERATE_LONGTEXT, true ); + add_integer( "dshow-audio-bitspersample", 0, NULL, AUDIO_BITSPERSAMPLE_TEXT, + AUDIO_BITSPERSAMPLE_LONGTEXT, true ); + add_shortcut( "dshow" ); set_capability( "access_demux", 0 ); set_callbacks( DemuxOpen, DemuxClose ); @@ -909,7 +929,10 @@ static int OpenDevice( vlc_object_t *p_this, access_sys_t *p_sys, size_t media_count = EnumDeviceCaps( p_this, p_device_filter, b_audio ? 0 : p_sys->i_chroma, p_sys->i_width, p_sys->i_height, - 0, 0, 0, media_types, MAX_MEDIA_TYPES ); + b_audio ? var_CreateGetInteger( p_this, "dshow-audio-channels" ) : 0, + b_audio ? var_CreateGetInteger( p_this, "dshow-audio-samplerate" ) : 0, + b_audio ? var_CreateGetInteger( p_this, "dshow-audio-bitspersample" ) : 0, + media_types, MAX_MEDIA_TYPES ); AM_MEDIA_TYPE *mt = NULL; @@ -1617,7 +1640,7 @@ static block_t *ReadCompressed( access_t *p_access ) while( 1 ) { - if( p_access->b_die || p_access->b_error ) return 0; + if( !vlc_object_alive (p_access) || p_access->b_error ) return 0; /* Get new sample/frame from the elementary stream (blocking). */ vlc_mutex_lock( &p_sys->lock );