]> git.sesse.net Git - vlc/blobdiff - modules/access/v4l/v4l.c
* changed some strings as suggested by E-bola
[vlc] / modules / access / v4l / v4l.c
index d2b41890bf63d987a982022701173b113faa7f17..8c501368e87580018dd1149600f8586c2af3f89a 100644 (file)
@@ -111,9 +111,9 @@ static void Close( vlc_object_t * );
 #define HUE_TEXT N_( "Hue" )
 #define HUE_LONGTEXT N_( \
     "Set the Hue of the video input" )
-#define COLOUR_TEXT N_( "Colour" )
+#define COLOUR_TEXT N_( "Color" )
 #define COLOUR_LONGTEXT N_( \
-    "Set the Colour of the video input" )
+    "Set the Color of the video input" )
 #define CONTRAST_TEXT N_( "Contrast" )
 #define CONTRAST_LONGTEXT N_( \
     "Set the Contrast of the video input" )
@@ -135,7 +135,7 @@ static void Close( vlc_object_t * );
 #define QUALITY_LONGTEXT N_( "Set the quality of the stream" )
 #define FPS_TEXT N_( "Framerate" )
 #define FPS_LONGTEXT N_( "Framerate to capture, if applicable " \
-    "(-1 for auto)" )
+    "(-1 for autodetect)" )
 
 static int i_norm_list[] =
     { VIDEO_MODE_AUTO, VIDEO_MODE_SECAM, VIDEO_MODE_PAL, VIDEO_MODE_NTSC };
@@ -360,13 +360,13 @@ static int Open( vlc_object_t *p_this )
 
     var_Create( p_demux, "v4l-height", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
     var_Get( p_demux, "v4l-height", &val );
-    p_sys->i_width          = val.i_int;
+    p_sys->i_height         = val.i_int;
 
     p_sys->i_video_pts      = -1;
 
     var_Create( p_demux, "v4l-brightness", VLC_VAR_INTEGER |
                                                         VLC_VAR_DOINHERIT );
-    var_Get( p_demux, "v4l-brighness", &val );
+    var_Get( p_demux, "v4l-brightness", &val );
     p_sys->i_brightness     = val.i_int;
 
     var_Create( p_demux, "v4l-hue", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
@@ -1111,6 +1111,19 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
         p_sys->i_width  = vid_win.width;
         p_sys->i_height = vid_win.height;
 
+        if( !p_sys->i_width || !p_sys->i_height )
+        {
+            p_sys->i_width = p_sys->vid_cap.maxwidth;
+            p_sys->i_height = p_sys->vid_cap.maxheight;
+        }
+
+        if( !p_sys->i_width || !p_sys->i_height )
+        {
+            msg_Err( p_demux, "invalid video size (%ix%i)",
+                     p_sys->i_width, p_sys->i_height );
+            goto vdev_failed;
+        }
+
         msg_Dbg( p_demux, "will use %dx%d", p_sys->i_width, p_sys->i_height );
     }