Commit 1a69168c authored by Yann Diorcet's avatar Yann Diorcet
Browse files

Fix old/new avcodec library detection

parent d808b43a
...@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ffmpeg-priv.h" #include "ffmpeg-priv.h"
#ifdef FF_API_ALLOC_CONTEXT
#if !FF_API_ALLOC_CONTEXT #if !FF_API_ALLOC_CONTEXT
AVCodecContext *avcodec_alloc_context(void) { AVCodecContext *avcodec_alloc_context(void) {
return avcodec_alloc_context3(NULL); return avcodec_alloc_context3(NULL);
...@@ -28,8 +29,11 @@ void avcodec_get_context_defaults(AVCodecContext *s) { ...@@ -28,8 +29,11 @@ void avcodec_get_context_defaults(AVCodecContext *s) {
avcodec_get_context_defaults3(s, NULL); avcodec_get_context_defaults3(s, NULL);
} }
#endif #endif
#endif
#ifdef FF_API_AVCODEC_OPEN
#if !FF_API_AVCODEC_OPEN #if !FF_API_AVCODEC_OPEN
int avcodec_open(AVCodecContext *avctx, AVCodec *codec) { int avcodec_open(AVCodecContext *avctx, AVCodec *codec) {
return avcodec_open2(avctx, codec, NULL); return avcodec_open2(avctx, codec, NULL);
} }
#endif #endif
#endif
...@@ -69,14 +69,18 @@ static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, ...@@ -69,14 +69,18 @@ static inline int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size); return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size);
} }
#endif #endif
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52,25,0) #if (LIBAVCODEC_VERSION_MAJOR >= 56)
#define CodecID AVCodecID #include <libavcodec/old_codec_ids.h>
#endif #endif
#ifdef FF_API_ALLOC_CONTEXT
#if !FF_API_ALLOC_CONTEXT #if !FF_API_ALLOC_CONTEXT
AVCodecContext *avcodec_alloc_context(void); AVCodecContext *avcodec_alloc_context(void);
void avcodec_get_context_defaults(AVCodecContext *s); void avcodec_get_context_defaults(AVCodecContext *s);
#endif #endif
#endif
#ifdef FF_API_AVCODEC_OPEN
#if !FF_API_AVCODEC_OPEN #if !FF_API_AVCODEC_OPEN
int avcodec_open(AVCodecContext *avctx, AVCodec *codec); int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
#endif #endif
#endif
#endif /* FFMPEG_PRIV_H */ #endif /* FFMPEG_PRIV_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment