diff options
author | Philip Langdale <philipl@overt.org> | 2015-09-25 08:18:12 -0700 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-25 17:29:44 +0200 |
commit | 361040f9d912140832192af78808218d601c7465 (patch) | |
tree | ee6b64f9573acc7e8cd2a8426d928d1df19db5ac | |
parent | d2281935b36b8fe80824b92e6238dc5e4b4e315a (diff) |
vd_lavc: Fix recovery from vdpau preemption
Flushing buffers, and thereby triggering decoder reinitialisation
needs to happen before attempting, and failing, to decode.
-rw-r--r-- | video/decode/vd_lavc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 3d29a9c7d9..1ecd65af6b 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -612,6 +612,9 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, struct vd_lavc_params *lavc_param = ctx->opts->vd_lavc_params; AVPacket pkt; + if (ctx->hwdec_request_reinit) + avcodec_flush_buffers(avctx); + if (flags) { // hr-seek framedrop vs. normal framedrop avctx->skip_frame = flags == 2 ? AVDISCARD_NONREF : lavc_param->framedrop; @@ -632,9 +635,6 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, return; } - if (ctx->hwdec_request_reinit) - avcodec_flush_buffers(avctx); - // Skipped frame, or delayed output due to multithreaded decoding. if (!got_picture) return; |