deps/media-playback: Fix compilation with older FFmpeg versions

Fixes an issue where media-playback would not compile with older FFmpeg
versions due to the fact that the AV_PIX_FMT_VIDEOTOOLBOX was
unavailable until version 54.31.100 of libavutil (FFmpeg 2.8).

Fixes mantis issue 1045.

Closes jp9000/obs-studio#1089
This commit is contained in:
pkviet
2017-12-02 03:51:13 +01:00
committed by jp9000
parent 94b5982216
commit 89bc6bdc03
2 changed files with 7 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ static AVCodec *find_hardware_decoder(enum AVCodecID id)
while (hwa) {
if (hwa->id == id) {
if (hwa->pix_fmt == AV_PIX_FMT_VIDEOTOOLBOX ||
if (hwa->pix_fmt == AV_PIX_FMT_VDTOOL ||
hwa->pix_fmt == AV_PIX_FMT_DXVA2_VLD ||
hwa->pix_fmt == AV_PIX_FMT_VAAPI_VLD) {
c = avcodec_find_decoder_by_name(hwa->name);

View File

@@ -44,6 +44,12 @@ extern "C" {
#define CODEC_FLAG_TRUNC CODEC_FLAG_TRUNCATED
#endif
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(54, 31, 100)
#define AV_PIX_FMT_VDTOOL AV_PIX_FMT_VIDEOTOOLBOX
#else
#define AV_PIX_FMT_VDTOOL AV_PIX_FMT_VDA_VLD
#endif
struct mp_media;
struct mp_decode {