diff mbox series

[FFmpeg-devel,15/21] avcodec/mpegvideo: Move timecode_frame_start to Mpeg1Context

Message ID AM7PR03MB666024D61AAB00CFC152C9558F5F9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 757be51dedbad231490e73e9b69a87f9bc51f81c
Headers show
Series [FFmpeg-devel,01/21] avcodec/h263: Remove declaration for inexistent function | expand

Checks

Context Check Description
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 25, 2022, 5:41 p.m. UTC
It is only used there and only by the main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpeg12dec.c | 11 ++++++-----
 libavcodec/mpegvideo.h |  1 -
 2 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index dbbf9bd819..0c5eddb7f1 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -75,6 +75,7 @@  typedef struct Mpeg1Context {
     int tmpgexs;
     int first_slice;
     int extradata_decoded;
+    int64_t timecode_frame_start;  /*< GOP timecode frame start number, in non drop frame format */
 } Mpeg1Context;
 
 #define MB_TYPE_ZERO_MV   0x20000000
@@ -2443,7 +2444,7 @@  static void mpeg_decode_gop(AVCodecContext *avctx,
 
     init_get_bits(&s->gb, buf, buf_size * 8);
 
-    tc = s-> timecode_frame_start = get_bits(&s->gb, 25);
+    tc = s1->timecode_frame_start = get_bits(&s->gb, 25);
 
     s1->closed_gop = get_bits1(&s->gb);
     /* broken_link indicates that after editing the
@@ -2854,19 +2855,19 @@  static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
     if (ret<0 || *got_output) {
         s2->current_picture_ptr = NULL;
 
-        if (s2->timecode_frame_start != -1 && *got_output) {
+        if (s->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));
             if (!tcside)
                 return AVERROR(ENOMEM);
-            memcpy(tcside->data, &s2->timecode_frame_start, sizeof(int64_t));
+            memcpy(tcside->data, &s->timecode_frame_start, sizeof(int64_t));
 
-            av_timecode_make_mpeg_tc_string(tcbuf, s2->timecode_frame_start);
+            av_timecode_make_mpeg_tc_string(tcbuf, s->timecode_frame_start);
             av_dict_set(&picture->metadata, "timecode", tcbuf, 0);
 
-            s2->timecode_frame_start = -1;
+            s->timecode_frame_start = -1;
         }
     }
 
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index e093e8c04a..fd9d60b03e 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -443,7 +443,6 @@  typedef struct MpegEncContext {
     // picture structure defines are loaded from mpegutils.h
     int picture_structure;
 
-    int64_t timecode_frame_start; ///< GOP timecode frame start number, in non drop frame format
     int intra_dc_precision;
     int frame_pred_frame_dct;
     int top_field_first;