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.
#include "ffmpeg-priv.h"
#ifdef FF_API_ALLOC_CONTEXT
#if !FF_API_ALLOC_CONTEXT
AVCodecContext *avcodec_alloc_context(void) {
return avcodec_alloc_context3(NULL);
......@@ -28,8 +29,11 @@ void avcodec_get_context_defaults(AVCodecContext *s) {
avcodec_get_context_defaults3(s, NULL);
}
#endif
#endif
#ifdef FF_API_AVCODEC_OPEN
#if !FF_API_AVCODEC_OPEN
int avcodec_open(AVCodecContext *avctx, AVCodec *codec) {
return avcodec_open2(avctx, codec, NULL);
}
#endif
#endif
......@@ -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);
}
#endif
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52,25,0)
#define CodecID AVCodecID
#if (LIBAVCODEC_VERSION_MAJOR >= 56)
#include <libavcodec/old_codec_ids.h>
#endif
#ifdef FF_API_ALLOC_CONTEXT
#if !FF_API_ALLOC_CONTEXT
AVCodecContext *avcodec_alloc_context(void);
void avcodec_get_context_defaults(AVCodecContext *s);
#endif
#endif
#ifdef FF_API_AVCODEC_OPEN
#if !FF_API_AVCODEC_OPEN
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
#endif
#endif
#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