Commit c803a550 authored by Ilkka Ollakka's avatar Ilkka Ollakka

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.
parent 851643ca
...@@ -194,7 +194,7 @@ static int ParseLine( char *psz_line, char **ppsz_name, ...@@ -194,7 +194,7 @@ static int ParseLine( char *psz_line, char **ppsz_name,
char ***pppsz_options, int *pi_options ) char ***pppsz_options, int *pi_options )
{ {
char *psz_name = NULL, *psz_parse = psz_line; 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; bool b_valid = false;
if( pppsz_options ) *pppsz_options = NULL; if( pppsz_options ) *pppsz_options = NULL;
...@@ -257,6 +257,12 @@ static int ParseLine( char *psz_line, char **ppsz_name, ...@@ -257,6 +257,12 @@ static int ParseLine( char *psz_line, char **ppsz_name,
i_value = strtol( psz_parse, &psz_end, 10 ); i_value = strtol( psz_parse, &psz_end, 10 );
if( psz_end != psz_parse && 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_value != LONG_MAX && i_value != LONG_MIN )
{ {
i_program = i_value; i_program = i_value;
...@@ -300,6 +306,14 @@ static int ParseLine( char *psz_line, char **ppsz_name, ...@@ -300,6 +306,14 @@ static int ParseLine( char *psz_line, char **ppsz_name,
INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options), INSERT_ELEM( *pppsz_options, (*pi_options), (*pi_options),
psz_option ); 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 ); if( ppsz_name && psz_name ) *ppsz_name = strdup( psz_name );
return b_valid; return b_valid;
......
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