Skip to content
Snippets Groups Projects
Commit c5d907b6 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

libavcodec: Handle param change side data in avcodec_decode_video2, too


Also call avcodec_set_dimensions on dimension param change packets.

Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 867f923d
No related branches found
No related tags found
No related merge requests found
...@@ -879,6 +879,7 @@ static void apply_param_change(AVCodecContext *avctx, AVPacket *avpkt) ...@@ -879,6 +879,7 @@ static void apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
return; return;
avctx->width = bytestream_get_le32(&data); avctx->width = bytestream_get_le32(&data);
avctx->height = bytestream_get_le32(&data); avctx->height = bytestream_get_le32(&data);
avcodec_set_dimensions(avctx, avctx->width, avctx->height);
size -= 8; size -= 8;
} }
} }
...@@ -894,6 +895,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi ...@@ -894,6 +895,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
return -1; return -1;
avctx->pkt = avpkt; avctx->pkt = avpkt;
apply_param_change(avctx, avpkt);
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type&FF_THREAD_FRAME)){ if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size || (avctx->active_thread_type&FF_THREAD_FRAME)){
if (HAVE_THREADS && avctx->active_thread_type&FF_THREAD_FRAME) if (HAVE_THREADS && avctx->active_thread_type&FF_THREAD_FRAME)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment