]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpeg12dec.c
avcodec/cfhd: improve SampleIndex tag output
[ffmpeg] / libavcodec / mpeg12dec.c
index f0f92accf60a8834bc04e698b939fe6cd2d60c9f..ab470187a1bbe57c3b190584c021543b724a4f00 100644 (file)
@@ -2276,6 +2276,8 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
             if (ret >= 0) {
                 uint8_t field, cc1, cc2;
                 uint8_t *cap = s1->a53_buf_ref->data;
+
+                memset(s1->a53_buf_ref->data + old_size, 0, cc_count * 3);
                 for (i = 0; i < cc_count && get_bits_left(&gb) >= 26; i++) {
                     skip_bits(&gb, 2); // priority
                     field = get_bits(&gb, 2);
@@ -2853,6 +2855,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
         s2->current_picture_ptr = NULL;
 
         if (s2->timecode_frame_start != -1 && *got_output) {
+            char tcbuf[AV_TIMECODE_STR_SIZE];
             AVFrameSideData *tcside = av_frame_new_side_data(picture,
                                                              AV_FRAME_DATA_GOP_TIMECODE,
                                                              sizeof(int64_t));
@@ -2860,6 +2863,9 @@ static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
                 return AVERROR(ENOMEM);
             memcpy(tcside->data, &s2->timecode_frame_start, sizeof(int64_t));
 
+            av_timecode_make_mpeg_tc_string(tcbuf, s2->timecode_frame_start);
+            av_dict_set(&picture->metadata, "timecode", tcbuf, 0);
+
             s2->timecode_frame_start = -1;
         }
     }