diff mbox series

[FFmpeg-devel,03/21] fftools/ffmpeg: drop OutputStream.pict_type

Message ID 20230427142601.2613-3-anton@khirnov.net
State Accepted
Commit 52b632b65be91264543065296a6a197d2a087c70
Headers show
Series [FFmpeg-devel,01/21] fftools/ffmpeg: deprecate -adrift_threshold | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov April 27, 2023, 2:25 p.m. UTC
It is no longer used outside of update_video_stats(), so make it a stack
variable in that function.
---
 fftools/ffmpeg.h     | 3 ---
 fftools/ffmpeg_enc.c | 5 +++--
 2 files changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index a41bc9b518..c3cb365a3b 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -671,9 +671,6 @@  typedef struct OutputStream {
     /* packet quality factor */
     int quality;
 
-    /* packet picture type */
-    int pict_type;
-
     /* frame encode sum of squared error values */
     int64_t error[4];
 
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 859c7fdeee..096e0ce14a 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -587,11 +587,12 @@  static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write
     const uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS,
                                                 NULL);
     AVCodecContext *enc = ost->enc_ctx;
+    enum AVPictureType pict_type;
     int64_t frame_number;
     double ti1, bitrate, avg_bitrate;
 
     ost->quality   = sd ? AV_RL32(sd) : -1;
-    ost->pict_type = sd ? sd[4] : AV_PICTURE_TYPE_NONE;
+    pict_type      = sd ? sd[4] : AV_PICTURE_TYPE_NONE;
 
     for (int i = 0; i<FF_ARRAY_ELEMS(ost->error); i++) {
         if (sd && i < sd[5])
@@ -634,7 +635,7 @@  static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write
     avg_bitrate = (double)(e->data_size * 8) / ti1 / 1000.0;
     fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
            (double)e->data_size / 1024, ti1, bitrate, avg_bitrate);
-    fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(ost->pict_type));
+    fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(pict_type));
 }
 
 static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)