]> git.sesse.net Git - vlc/blobdiff - modules/access/v4l.c
MKV: code factorisation around extra_data filling
[vlc] / modules / access / v4l.c
index fed09f95bba6955701e37de506f7455a17d4c34d..28c1a008425cd7a76b16905eab6fca362e6faa4a 100644 (file)
@@ -39,6 +39,7 @@
 #include <vlc_access.h>
 #include <vlc_picture.h>
 #include <vlc_charset.h>
+#include <vlc_fs.h>
 
 #include <sys/ioctl.h>
 #include <sys/mman.h>
@@ -288,7 +289,7 @@ struct demux_sys_t
 #   define v4l1_ioctl ioctl
 #   define v4l1_mmap mmap
 #   define v4l1_munmap munmap
-#   define v4l1_open utf8_open
+#   define v4l1_open vlc_open
 #endif
 
 /*****************************************************************************
@@ -360,7 +361,8 @@ static int Open( vlc_object_t *p_this )
     es_format_Init( &fmt, VIDEO_ES, p_sys->i_fourcc );
     fmt.video.i_width  = p_sys->i_width;
     fmt.video.i_height = p_sys->i_height;
-    fmt.video.i_aspect = 4 * VOUT_ASPECT_FACTOR / 3;
+    fmt.video.i_sar_num = 4 * fmt.video.i_height;
+    fmt.video.i_sar_den = 3 * fmt.video.i_width;
 
     /* Setup rgb mask for RGB formats */
     switch( p_sys->i_fourcc )
@@ -1085,8 +1087,8 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
     {
         /* Fill in picture_t fields */
         if( picture_Setup( &p_sys->pic, p_sys->i_fourcc,
-                           p_sys->i_width, p_sys->i_height, p_sys->i_width *
-                           VOUT_ASPECT_FACTOR / p_sys->i_height ) )
+                           p_sys->i_width, p_sys->i_height,
+                           1, 1 ) )
         {
             msg_Err( p_demux, "unsupported chroma" );
             goto vdev_failed;