]> git.sesse.net Git - vlc/commitdiff
* "frequency=" is channel frequency in kHz again
authorBenjamin Pracht <bigben@videolan.org>
Thu, 24 Jul 2003 18:30:03 +0000 (18:30 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Thu, 24 Jul 2003 18:30:03 +0000 (18:30 +0000)
* fix  a segfault when "/dev/video0"  or "norm=" were last  arguments of
the command line

modules/access/pvr/pvr.c

index 68be85b62bf20182c3f154183fdfebb50156dbda..e45e7310413d658a1f7f56707f60e7ba8d676ab6 100644 (file)
@@ -2,7 +2,7 @@
  * pvr.c
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: pvr.c,v 1.5 2003/07/22 20:25:07 bigben Exp $
+ * $Id: pvr.c,v 1.6 2003/07/24 18:30:03 bigben Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
@@ -144,7 +144,8 @@ static int Open( vlc_object_t * p_this )
                 char *psz_parser_init;
                 psz_parser += strlen( "norm=" );
                 psz_parser_init = psz_parser;
-                while ( *psz_parser != ':' && *psz_parser != ',' )
+                while ( *psz_parser != ':' && *psz_parser != ',' 
+                                                    && *psz_parser != '\0' )
                 {
                     psz_parser++;
                 }
@@ -180,8 +181,8 @@ static int Open( vlc_object_t * p_this )
                                strlen( "frequency=" ) ) )
             {
                 p_sys->i_frequency =
-                    1000 * strtol( psz_parser + strlen( "frequency=" ),
-                            &psz_parser, 0 ) / 16;
+                  strtol( psz_parser + strlen( "frequency=" ),
+                            &psz_parser, 0 );
             }
             else if( !strncmp( psz_parser, "framerate=",
                                strlen( "framerate=" ) ) )
@@ -233,7 +234,8 @@ static int Open( vlc_object_t * p_this )
             {
                 char *psz_parser_init;
                 psz_parser_init = psz_parser;
-                while ( *psz_parser != ':' && *psz_parser != ',' )
+                while ( *psz_parser != ':' && *psz_parser != ',' 
+                                                    && *psz_parser != '\0' )
                 {
                     psz_parser++;
                 }