diff mbox series

[FFmpeg-devel,05/12] fftools/ffmpeg: move InputStream.codec_desc to private data

Message ID 20231213193007.17471-5-anton@khirnov.net
State Accepted
Commit 882bc8049dea90bf8c9091c02b06c2309892111e
Headers show
Series [FFmpeg-devel,01/12] fftools/ffmpeg_filter: move FilterGraph.graph to FilterGraphThread | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Dec. 13, 2023, 7:30 p.m. UTC
It is not used outside of ffmpeg_demux.
---
 fftools/ffmpeg.h       | 1 -
 fftools/ffmpeg_demux.c | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 0bab44cefc..f214e4efcb 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -353,7 +353,6 @@  typedef struct InputStream {
     Decoder *decoder;
     AVCodecContext *dec_ctx;
     const AVCodec *dec;
-    const AVCodecDescriptor *codec_desc;
 
     AVRational framerate_guessed;
 
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 9779580819..865c1e7d2f 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -83,6 +83,8 @@  typedef struct DemuxStream {
     ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
     int64_t       dts;
 
+    const AVCodecDescriptor *codec_desc;
+
     /* number of packets successfully read for this stream */
     uint64_t nb_packets;
     // combined size of all the packets read
@@ -320,8 +322,8 @@  static int ist_dts_update(DemuxStream *ds, AVPacket *pkt)
                                              (AVRational){ 2, 1 });
             int fields = 2;
 
-            if (ist->codec_desc                                 &&
-                (ist->codec_desc->props & AV_CODEC_PROP_FIELDS) &&
+            if (ds->codec_desc                                 &&
+                (ds->codec_desc->props & AV_CODEC_PROP_FIELDS) &&
                 av_stream_get_parser(ist->st))
                 fields = 1 + av_stream_get_parser(ist->st)->repeat_pict;
 
@@ -1252,7 +1254,7 @@  static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
         return ret;
     }
 
-    ist->codec_desc = avcodec_descriptor_get(ist->par->codec_id);
+    ds->codec_desc = avcodec_descriptor_get(ist->par->codec_id);
 
     return 0;
 }