summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-06-20 19:34:47 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-07-09 22:18:42 +0800
commitdcf9235a877f2330c96dcfbf65a0e0671e0b7150 (patch)
treecee1fd093b42f115a97c1ac2be04a83541709d9d /libavcodec/hevcdec.c
parent3adffab073bc59af39dddd035168ac72bc9ffde3 (diff)
avcodec/hevcdec: add timecode metadata
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index e363e68630..3691814805 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2820,6 +2820,7 @@ static int set_side_data(HEVCContext *s)
if (s->sei.timecode.present) {
uint32_t *tc_sd;
+ char tcbuf[AV_TIMECODE_STR_SIZE];
AVFrameSideData *tcside = av_frame_new_side_data(out, AV_FRAME_DATA_S12M_TIMECODE,
sizeof(uint32_t) * 4);
if (!tcside)
@@ -2836,6 +2837,8 @@ static int set_side_data(HEVCContext *s)
int ff = s->sei.timecode.n_frames[i];
tc_sd[i + 1] = av_timecode_get_smpte(s->avctx->framerate, drop, hh, mm, ss, ff);
+ av_timecode_make_smpte_tc_string(tcbuf, tc_sd[i + 1], 0);
+ av_dict_set(&out->metadata, "timecode", tcbuf, 0);
}
s->sei.timecode.num_clock_ts = 0;