From: Ilkka Ollakka Date: Sat, 17 Jan 2009 13:26:48 +0000 (+0200) Subject: channels.conf demux: parse symbol-rate from playlist X-Git-Tag: 1.0.0-pre1~1296 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c803a55009f0ae786ca6e45d348b16cf52bf1e0b;p=vlc channels.conf demux: parse symbol-rate from playlist Without this I needed to give --dvb-srate=6875000 to vlc with channels.conf file for it to work proberly, please review that it doesn't cause any funky issues to other than dvb-c stuff. --- diff --git a/modules/demux/playlist/dvb.c b/modules/demux/playlist/dvb.c index c2c6dc39ee..ffbdbb3697 100644 --- a/modules/demux/playlist/dvb.c +++ b/modules/demux/playlist/dvb.c @@ -194,7 +194,7 @@ static int ParseLine( char *psz_line, char **ppsz_name, char ***pppsz_options, int *pi_options ) { char *psz_name = NULL, *psz_parse = psz_line; - int i_count = 0, i_program = 0, i_frequency = 0; + int i_count = 0, i_program = 0, i_frequency = 0, i_symbolrate = 0; bool b_valid = false; if( pppsz_options ) *pppsz_options = NULL; @@ -257,6 +257,12 @@ static int ParseLine( char *psz_line, char **ppsz_name, i_value = strtol( psz_parse, &psz_end, 10 ); if( psz_end != psz_parse && + i_value != LONG_MAX && i_value != LONG_MIN && + !i_symbolrate ) + { + i_symbolrate = i_value; + } + else if( psz_end != psz_parse && i_value != LONG_MAX && i_value != LONG_MIN ) { i_program = i_value; @@ -300,6 +306,14 @@ static int ParseLine( char *psz_line, char **ppsz_name, INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options), psz_option ); } + if( i_symbolrate && pppsz_options && pi_options ) + { + char *psz_option; + + if( asprintf( &psz_option, "dvb-srate=%i", i_symbolrate ) != -1 ) + INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options), + psz_option ); + } if( ppsz_name && psz_name ) *ppsz_name = strdup( psz_name ); return b_valid;