fix build on libavtools < 12

pull/3044/head
Isaac Connor 2020-03-11 10:54:35 -04:00
parent 9beb5cee3a
commit 050868fad1
1 changed files with 14 additions and 0 deletions

View File

@ -40,6 +40,7 @@ extern "C" {
#include <libavutil/mathematics.h>
#include <libavutil/avstring.h>
#include "libavutil/audio_fifo.h"
#include "libavutil/pixfmt.h"
/* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg
* The original source is vlc (in modules/codec/avcodec/avcommon_compat.h)
@ -321,6 +322,7 @@ void zm_dump_codecpar(const AVCodecParameters *par);
frame->pts \
);
#if LIBAVUTIL_VERSION_CHECK(54, 4, 0, 74, 100)
#define zm_dump_video_frame(frame,text) Debug(1, "%s: format %d %s %dx%d linesize:%dx%d pts: %" PRId64, \
text, \
frame->format, \
@ -331,6 +333,18 @@ void zm_dump_codecpar(const AVCodecParameters *par);
frame->pts \
);
#else
#define zm_dump_video_frame(frame,text) Debug(1, "%s: format %d %s %dx%d linesize:%dx%d pts: %" PRId64, \
text, \
frame->format, \
"unsupported", \
frame->width, \
frame->height, \
frame->linesize[0], frame->linesize[1], \
frame->pts \
);
#endif
#if LIBAVCODEC_VERSION_CHECK(56, 8, 0, 60, 100)
#define zm_av_packet_unref( packet ) av_packet_unref( packet )
#define zm_av_packet_ref( dst, src ) av_packet_ref( dst, src )