]> git.sesse.net Git - vlc/blobdiff - modules/access/dshow/dshow.cpp
Merge branch 1.0-bugfix (early part) into master
[vlc] / modules / access / dshow / dshow.cpp
index 729648aa58514ef23484b54e902de7903db2d7b4..79c77f642aaba39a94e9363db8a42e3d1455a057 100644 (file)
@@ -38,7 +38,6 @@
 #include <vlc_input.h>
 #include <vlc_access.h>
 #include <vlc_demux.h>
-#include <vlc_vout.h>
 #include <vlc_dialog.h>
 #include <vlc_charset.h>
 
@@ -349,7 +348,8 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
 
     /* Get/parse options and open device(s) */
     string vdevname, adevname;
-    int i_width = 0, i_height = 0, i_chroma = 0;
+    int i_width = 0, i_height = 0;
+    vlc_fourcc_t i_chroma = 0;
     bool b_use_audio = true;
     bool b_use_video = true;
 
@@ -419,13 +419,9 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
     p_sys->b_chroma = false;
     var_Create( p_this, "dshow-chroma", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Get( p_this, "dshow-chroma", &val );
-    if( val.psz_string && strlen( val.psz_string ) >= 4 )
-    {
-        i_chroma = vlc_fourcc_GetCodec( UNKNOWN_ES,
-                                        VLC_FOURCC( val.psz_string[0], val.psz_string[1],
-                                                    val.psz_string[2], val.psz_string[3] ) );
-        p_sys->b_chroma = true;
-    }
+
+    i_chroma = vlc_fourcc_GetCodecFromString( UNKNOWN_ES, val.psz_string );
+    p_sys->b_chroma = i_chroma != 0;
     free( val.psz_string );
 
     var_Create( p_this, "dshow-fps", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
@@ -491,7 +487,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
             if( /* Raw DV stream */
                 p_stream->i_fourcc == VLC_CODEC_DV ||
                 /* Raw MPEG video stream */
-                p_stream->i_fourcc == VLC_CODEC_MP2V )
+                p_stream->i_fourcc == VLC_CODEC_MPGV )
             {
                 b_use_audio = false;
 
@@ -729,7 +725,7 @@ static int AccessOpen( vlc_object_t *p_this )
             free( p_access->psz_demux );
             p_access->psz_demux = strdup( "rawdv" );
         }
-        else if( p_stream->i_fourcc == VLC_CODEC_MP2V )
+        else if( p_stream->i_fourcc == VLC_CODEC_MPGV )
         {
             free( p_access->psz_demux );
             p_access->psz_demux = strdup( "mpgv" );