History

avcodec/decode: inject missing global side data to output frames

ff_decode_frame_props() injects global side data passed by the caller (Usually coming from the container) but ignores the global side data the decoder gathered from the bitstream itself. This commit amends this.

James Almer committed 1 year ago

Commit 603334e1 parent 964d28e1 file · +9 −0Browse files

Unified · Split

libavcodec/decode.c+9−0
@@ -1570,6 +1570,15 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) · 1569 unmodified lines
1570 if (ret < 0)1570 if (ret < 0)
1571 return ret;1571 return ret;
1572 1572
1573 for (int i = 0; i < avctx->nb_decoded_side_data; i++) {
1574 const AVFrameSideData *src = avctx->decoded_side_data[i];
1575 if (av_frame_get_side_data(frame, src->type))
1576 continue;
1577 ret = av_frame_side_data_clone(&frame->side_data, &frame->nb_side_data, src, 0);
1578 if (ret < 0)
1579 return ret;
1580 }
1581
1573 if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {1582 if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) {
1574 const AVPacket *pkt = avctx->internal->last_pkt_props;1583 const AVPacket *pkt = avctx->internal->last_pkt_props;
1575 1584

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t