diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-03 15:33:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-03 15:34:00 +0100 |
commit | e9314f196880092e1177fd19ca00b01033362b0b (patch) | |
tree | e9726fec0dec8bb1bb9eda968725003669ee2211 | |
parent | 889afca369ef3a939c68592ef2b1a1756667ce21 (diff) | |
parent | 31a0ca9e75e4c91437c8681b9655a67f09b693dd (diff) | |
download | ffmpeg-streaming-e9314f196880092e1177fd19ca00b01033362b0b.zip ffmpeg-streaming-e9314f196880092e1177fd19ca00b01033362b0b.tar.gz |
Merge remote-tracking branch 'dilaroga/master'
* dilaroga/master:
vda: fix crash when a frame is dropped.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/vda.h | 6 | ||||
-rw-r--r-- | libavcodec/vda_h264.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/vda.h b/libavcodec/vda.h index b3d6399..2f68188 100644 --- a/libavcodec/vda.h +++ b/libavcodec/vda.h @@ -41,6 +41,12 @@ #include "libavcodec/version.h" +// extra flags not defined in VDADecoder.h +enum { + kVDADecodeInfo_Asynchronous = 1UL << 0, + kVDADecodeInfo_FrameDropped = 1UL << 1 +}; + /** * @defgroup lavc_codec_hwaccel_vda VDA * @ingroup lavc_codec_hwaccel diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c index e0561e2..1eff671 100644 --- a/libavcodec/vda_h264.c +++ b/libavcodec/vda_h264.c @@ -41,6 +41,9 @@ static void vda_decoder_callback(void *vda_hw_ctx, { struct vda_context *vda_ctx = vda_hw_ctx; + if (infoFlags & kVDADecodeInfo_FrameDropped) + vda_ctx->cv_buffer = NULL; + if (!image_buffer) return; |