You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavc/pthread_frame: always transfer stashed hwaccel state
Fixes assertion failures after avcodec_flush_buffers(), where stashed hwaccel state is present, but prev_thread is NULL. Found-by: Wang Bin <wbsecg1@gmail.com>
This commit is contained in:
@@ -459,13 +459,13 @@ static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
|
|||||||
pthread_mutex_unlock(&p->mutex);
|
pthread_mutex_unlock(&p->mutex);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* transfer hwaccel state stashed from previous thread, if any */
|
/* transfer the stashed hwaccel state, if any */
|
||||||
av_assert0(!p->avctx->hwaccel);
|
av_assert0(!p->avctx->hwaccel);
|
||||||
FFSWAP(const AVHWAccel*, p->avctx->hwaccel, fctx->stash_hwaccel);
|
FFSWAP(const AVHWAccel*, p->avctx->hwaccel, fctx->stash_hwaccel);
|
||||||
FFSWAP(void*, p->avctx->hwaccel_context, fctx->stash_hwaccel_context);
|
FFSWAP(void*, p->avctx->hwaccel_context, fctx->stash_hwaccel_context);
|
||||||
FFSWAP(void*, p->avctx->internal->hwaccel_priv_data, fctx->stash_hwaccel_priv);
|
FFSWAP(void*, p->avctx->internal->hwaccel_priv_data, fctx->stash_hwaccel_priv);
|
||||||
}
|
|
||||||
|
|
||||||
av_packet_unref(p->avpkt);
|
av_packet_unref(p->avpkt);
|
||||||
ret = av_packet_ref(p->avpkt, avpkt);
|
ret = av_packet_ref(p->avpkt, avpkt);
|
||||||
|
Reference in New Issue
Block a user