]> git.sesse.net Git - vlc/blobdiff - modules/video_output/snapshot.c
Merge commit 'origin/1.0-bugfix'
[vlc] / modules / video_output / snapshot.c
index 2fc7c2af8f89885436fb48481c887723fef1b57a..411f1e56150ea038d79d906bc23c71ea39c16b2f 100644 (file)
@@ -154,7 +154,7 @@ static int Init( vout_thread_t *p_vout )
     picture_t *p_pic;
     vlc_value_t val;
     char* psz_chroma;
-    int i_chroma;
+    vlc_fourcc_t i_chroma;
     int i_width;
     int i_height;
     int i_datasize;
@@ -174,9 +174,13 @@ static int Init( vout_thread_t *p_vout )
                                psz_chroma[2], psz_chroma[3] );
         free( psz_chroma );
     }
-    else
+
+    i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
+    free( psz_chroma );
+
+    if( !i_chroma )
     {
-        msg_Err( p_vout, "Cannot find chroma information." );
+        msg_Err( p_vout, "snapshot-chroma should be 4 characters long" );
         return VLC_EGENERIC;
     }
 
@@ -194,25 +198,25 @@ static int Init( vout_thread_t *p_vout )
     /* Define the bitmasks */
     switch( i_chroma )
     {
-      case VLC_FOURCC( 'R','V','1','5' ):
+      case VLC_CODEC_RGB15:
         p_vout->output.i_rmask = 0x001f;
         p_vout->output.i_gmask = 0x03e0;
         p_vout->output.i_bmask = 0x7c00;
         break;
 
-      case VLC_FOURCC( 'R','V','1','6' ):
+      case VLC_CODEC_RGB16:
         p_vout->output.i_rmask = 0x001f;
         p_vout->output.i_gmask = 0x07e0;
         p_vout->output.i_bmask = 0xf800;
         break;
 
-      case VLC_FOURCC( 'R','V','2','4' ):
+      case VLC_CODEC_RGB24:
         p_vout->output.i_rmask = 0xff0000;
         p_vout->output.i_gmask = 0x00ff00;
         p_vout->output.i_bmask = 0x0000ff;
         break;
 
-      case VLC_FOURCC( 'R','V','3','2' ):
+      case VLC_CODEC_RGB32:
         p_vout->output.i_rmask = 0xff0000;
         p_vout->output.i_gmask = 0x00ff00;
         p_vout->output.i_bmask = 0x0000ff;