diff options
author | wm4 <wm4@nowhere> | 2015-10-19 18:19:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-19 18:19:57 +0200 |
commit | 50f8548b2f11a20cac2b55f6408b3cc4fe5df239 (patch) | |
tree | be31396220451d4e953ce99e10d91aa83befbea8 /video | |
parent | 0ab6031d76df43a8204e2bbc7eae2a93eb1cc383 (diff) |
vd_lavc: attempt to fallback from hwdec before anything is decoded
The previous commit moved the av_frame_unref() after the got_picture
check. This accidentally also deferred the software fallback
reinitialization to until a software picture was decoded (instead of the
exact time of the fallback), which is not ideal.
Just rely on the fact that calling av_frame_unref() on a frame is ok
even if nothing was decoded.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/vd_lavc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 6fdd1b2cfd..5c97526d7c 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -631,15 +631,15 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, return; } - // Skipped frame, or delayed output due to multithreaded decoding. - if (!got_picture) - return; - if (ctx->hwdec && ctx->hwdec_failed) { av_frame_unref(ctx->pic); return; } + // Skipped frame, or delayed output due to multithreaded decoding. + if (!got_picture) + return; + struct mp_image_params params; update_image_params(vd, ctx->pic, ¶ms); vd->codec_pts = mp_pts_from_av(ctx->pic->pkt_pts, NULL); |