]> 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 f06ce6d02a71d792f9a60f5ae1f3889936b30b7d..8c501368e87580018dd1149600f8586c2af3f89a 100644 (file)
@@ -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,7 +360,7 @@ 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;
 
@@ -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 );
     }