[vlc-devel] commit: channels.conf demux: parse symbol-rate from playlist ( Ilkka Ollakka )

git version control git at videolan.org
Sat Jan 17 14:50:58 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Jan 17 15:26:48 2009 +0200| [c803a55009f0ae786ca6e45d348b16cf52bf1e0b] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c803a55009f0ae786ca6e45d348b16cf52bf1e0b
---

 modules/demux/playlist/dvb.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/modules/demux/playlist/dvb.c b/modules/demux/playlist/dvb.c
index c2c6dc3..ffbdbb3 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;




More information about the vlc-devel mailing list