[vlc-commits] avcodec: fix av_pix_fmt_desc_get() with ffmpeg

Francois Cartegnie git at videolan.org
Sun Jul 21 21:34:11 CEST 2013


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jul 21 21:04:57 2013 +0200| [7a68780f8f676043a5cf1637130c930477597b62] | committer: Francois Cartegnie

avcodec: fix av_pix_fmt_desc_get() with ffmpeg

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a68780f8f676043a5cf1637130c930477597b62
---

 modules/codec/avcodec/avcommon_compat.h |    4 ++++
 modules/codec/avcodec/video.c           |    4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h
index bd8cfa2..024b250 100644
--- a/modules/codec/avcodec/avcommon_compat.h
+++ b/modules/codec/avcodec/avcommon_compat.h
@@ -499,6 +499,10 @@ enum {
 #   define AV_PIX_FMT_FLAG_HWACCEL  PIX_FMT_HWACCEL
 #endif
 
+#if !LIBAVUTIL_VERSION_CHECK( 51, 44, 0, 76, 100 )
+#   define av_pix_fmt_desc_get(a) &av_pix_fmt_descriptors[a]
+#endif
+
 #endif /* HAVE_LIBAVUTIL_AVUTIL_H */
 
 #endif
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 384aae6..18c7917 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1075,13 +1075,9 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
     bool can_hwaccel = false;
     for( size_t i = 0; pi_fmt[i] != PIX_FMT_NONE; i++ )
     {
-#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 44, 0)
         const AVPixFmtDescriptor *dsc = av_pix_fmt_desc_get(pi_fmt[i]);
         if (dsc == NULL)
             continue;
-#else
-        const AVPixFmtDescriptor *dsc = &av_pix_fmt_descriptors[pi_fmt[i]];
-#endif
         bool hwaccel = (dsc->flags & AV_PIX_FMT_FLAG_HWACCEL) != 0;
 
         msg_Dbg( p_dec, "available %sware decoder output format %d (%s)",



More information about the vlc-commits mailing list