diff mbox series

[FFmpeg-devel,2/4] avformat/dvdvideodec: Don't store AVInputFormat*

Message ID AS8P250MB0744ADFC92FC0051E49017D88F5D2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit e30dd9bbac2746d84a9c1f5fa34cec882785a1c2
Headers show
Series [FFmpeg-devel,1/4] avformat/dvdvideodec: Explicitly return 0 on success | 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

Andreas Rheinhardt March 2, 2024, 3:43 p.m. UTC
The inner AVInputFormat* of the inner mpegps-demuxer
is only used once (in avformat_open_input()), so
don't even store it. In fact, just use ff_mpegps_demuxer
directly, as this demuxer has a configure dependency
on it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/dvdvideodec.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c
index fd1f640560..ef2d4e6df4 100644
--- a/libavformat/dvdvideodec.c
+++ b/libavformat/dvdvideodec.c
@@ -136,7 +136,6 @@  typedef struct DVDVideoDemuxContext {
     int                         opt_trim;           /* trim padding cells at beginning */
 
     /* subdemux */
-    const AVInputFormat         *mpeg_fmt;          /* inner MPEG-PS (VOB) demuxer */
     AVFormatContext             *mpeg_ctx;          /* context for inner demuxer */
     uint8_t                     *mpeg_buf;          /* buffer for inner demuxer */
     FFIOContext                 mpeg_pb;            /* buffer context for inner demuxer */
@@ -1210,12 +1209,9 @@  static void dvdvideo_subdemux_close(AVFormatContext *s)
 static int dvdvideo_subdemux_open(AVFormatContext *s)
 {
     DVDVideoDemuxContext *c = s->priv_data;
-
+    extern const AVInputFormat ff_mpegps_demuxer;
     int ret = 0;
 
-    if (!(c->mpeg_fmt = av_find_input_format("mpeg")))
-        return AVERROR_DEMUXER_NOT_FOUND;
-
     if (!(c->mpeg_ctx = avformat_alloc_context()))
         return AVERROR(ENOMEM);
 
@@ -1246,7 +1242,7 @@  static int dvdvideo_subdemux_open(AVFormatContext *s)
     c->mpeg_ctx->correct_ts_overflow = 0;
     c->mpeg_ctx->io_open = NULL;
 
-    return avformat_open_input(&c->mpeg_ctx, "", c->mpeg_fmt, NULL);
+    return avformat_open_input(&c->mpeg_ctx, "", &ff_mpegps_demuxer, NULL);
 }
 
 static int dvdvideo_read_header(AVFormatContext *s)