]> git.sesse.net Git - vlc/blobdiff - modules/codec/avcodec/chroma.c
Qt4: compressor and Spatializer widget margin shouldn't be 0
[vlc] / modules / codec / avcodec / chroma.c
index 6e13170a3485f731c4cea5d59f3cc38dc7353ca0..8418e782a016a7c22ce628fef8219489f22055be 100644 (file)
 #include <vlc_common.h>
 #include <vlc_codec.h>
 
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
-#   include <libavcodec/avcodec.h>
-#elif defined(HAVE_FFMPEG_AVCODEC_H)
-#   include <ffmpeg/avcodec.h>
-#else
-#   include <avcodec.h>
-#endif
-#include "avcodec.h"
+#include <libavutil/avutil.h>
+#include "chroma.h"
 
 /*****************************************************************************
  * Chroma fourcc -> ffmpeg_id mapping
@@ -105,9 +99,7 @@ static const struct
     VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32, PIX_FMT_BGR32, 0x00ff0000, 0x0000ff00, 0x000000ff )
     VLC_RGB( VLC_CODEC_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32_1, 0xff000000, 0x00ff0000, 0x0000ff00 )
 
-#if defined(PIX_FMT_RGBA)
     {VLC_CODEC_RGBA, PIX_FMT_RGBA, 0xff000000, 0x00ff0000, 0x0000ff00},
-#endif
     {VLC_CODEC_GREY, PIX_FMT_GRAY8, 0, 0, 0},
 
      /* Paletized RGB */
@@ -134,9 +126,12 @@ int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t fmt )
     {
         if( chroma_table[i].i_chroma == fmt.i_chroma )
         {
-            if( chroma_table[i].i_rmask == fmt.i_rmask &&
-                chroma_table[i].i_gmask == fmt.i_gmask &&
-                chroma_table[i].i_bmask == fmt.i_bmask )
+            if( ( chroma_table[i].i_rmask == 0 &&
+                  chroma_table[i].i_gmask == 0 &&
+                  chroma_table[i].i_bmask == 0 ) ||
+                ( chroma_table[i].i_rmask == fmt.i_rmask &&
+                  chroma_table[i].i_gmask == fmt.i_gmask &&
+                  chroma_table[i].i_bmask == fmt.i_bmask ) )
             {
                 *i_ffmpeg_chroma = chroma_table[i].i_chroma_id;
                 return VLC_SUCCESS;