Commit 588c5c3d authored by Niklas Haas's avatar Niklas Haas Committed by Anton Khirnov

avcodec/dpx: respect side data preference

If the time code side data is overridden by the packet level, we also
make sure not to update `p->metadata` to a mismatched timecode.
parent 0b7aefe6
......@@ -287,12 +287,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
tc = av_bswap32(read32(&buf, endian));
if (i != 0xFFFFFFFF) {
AVFrameSideData *tcside =
av_frame_new_side_data(p, AV_FRAME_DATA_S12M_TIMECODE,
sizeof(uint32_t) * 4);
if (!tcside)
return AVERROR(ENOMEM);
AVFrameSideData *tcside;
ret = ff_frame_new_side_data(avctx, p, AV_FRAME_DATA_S12M_TIMECODE,
sizeof(uint32_t) * 4, &tcside);
if (ret < 0)
return ret;
if (tcside) {
tc_sd = (uint32_t*)tcside->data;
tc_sd[0] = 1;
tc_sd[1] = tc;
......@@ -302,6 +303,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
av_dict_set(&p->metadata, "timecode", tcbuf, 0);
}
}
}
/* color range from television header */
if (offset >= 1964 + 4) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment