summaryrefslogtreecommitdiffstats
path: root/libavcodec/libopenh264dec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-02-20 15:43:30 -0300
committerJames Almer <jamrial@gmail.com>2019-02-20 15:43:30 -0300
commitf05f210526a3dc2d9fa6b1c228e3907ebd1d43c6 (patch)
tree0b87c7feeb138233f309e7933f4cd4012cf60068 /libavcodec/libopenh264dec.c
parente4e04dce1fab81bcdef82e60184d50c73d212c6a (diff)
parenteec93e57096aa4804862d62760442380c70d489b (diff)
downloadffmpeg-streaming-f05f210526a3dc2d9fa6b1c228e3907ebd1d43c6.zip
ffmpeg-streaming-f05f210526a3dc2d9fa6b1c228e3907ebd1d43c6.tar.gz
Merge commit 'eec93e57096aa4804862d62760442380c70d489b'
* commit 'eec93e57096aa4804862d62760442380c70d489b': libopenh264dec: Use a newer decoding entry point function Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libopenh264dec.c')
-rw-r--r--libavcodec/libopenh264dec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index f9b91ce..c7aa7fa 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -109,10 +109,18 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data,
#endif
} else {
info.uiInBsTimeStamp = avpkt->pts;
+#if OPENH264_VER_AT_LEAST(1, 4)
+ // Contrary to the name, DecodeFrameNoDelay actually does buffering
+ // and reordering of frames, and is the recommended decoding entry
+ // point since 1.4. This is essential for successfully decoding
+ // B-frames.
+ state = (*s->decoder)->DecodeFrameNoDelay(s->decoder, avpkt->data, avpkt->size, ptrs, &info);
+#else
state = (*s->decoder)->DecodeFrame2(s->decoder, avpkt->data, avpkt->size, ptrs, &info);
+#endif
}
if (state != dsErrorFree) {
- av_log(avctx, AV_LOG_ERROR, "DecodeFrame2 failed\n");
+ av_log(avctx, AV_LOG_ERROR, "DecodeFrame failed\n");
return AVERROR_UNKNOWN;
}
if (info.iBufferStatus != 1) {
OpenPOWER on IntegriCloud