mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 09:29:29 +00:00
vd_lavc: fix avctx NULL checks
If reinit after a fallback from hardware fails, this field can be NULL. The check in control() was broken due to a typo (found by Coverity), and decode() lacked the check entirely.
This commit is contained in:
parent
c46106d633
commit
565efeeada
@ -624,6 +624,9 @@ static void decode(struct dec_video *vd, struct demux_packet *packet,
|
||||
struct vd_lavc_params *opts = ctx->opts->vd_lavc_params;
|
||||
AVPacket pkt;
|
||||
|
||||
if (!avctx)
|
||||
return;
|
||||
|
||||
if (flags) {
|
||||
// hr-seek framedrop vs. normal framedrop
|
||||
avctx->skip_frame = flags == 2 ? AVDISCARD_NONREF : opts->framedrop;
|
||||
@ -724,7 +727,7 @@ static int control(struct dec_video *vd, int cmd, void *arg)
|
||||
return CONTROL_TRUE;
|
||||
case VDCTRL_QUERY_UNSEEN_FRAMES: {
|
||||
AVCodecContext *avctx = ctx->avctx;
|
||||
if (!ctx)
|
||||
if (!avctx)
|
||||
break;
|
||||
if (ctx->hwdec && ctx->hwdec->type == HWDEC_RPI)
|
||||
break; // MMAL has arbitrary buffering, thus unknown
|
||||
|
Loading…
Reference in New Issue
Block a user