avformat/dvdvideodec: Don't store AVInputFormat*
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. Reviewed-by: Marth64 <marth64@proxyid.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -136,7 +136,6 @@ typedef struct DVDVideoDemuxContext {
|
|||||||
int opt_trim; /* trim padding cells at beginning */
|
int opt_trim; /* trim padding cells at beginning */
|
||||||
|
|
||||||
/* subdemux */
|
/* subdemux */
|
||||||
const AVInputFormat *mpeg_fmt; /* inner MPEG-PS (VOB) demuxer */
|
|
||||||
AVFormatContext *mpeg_ctx; /* context for inner demuxer */
|
AVFormatContext *mpeg_ctx; /* context for inner demuxer */
|
||||||
uint8_t *mpeg_buf; /* buffer for inner demuxer */
|
uint8_t *mpeg_buf; /* buffer for inner demuxer */
|
||||||
FFIOContext mpeg_pb; /* buffer context 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)
|
static int dvdvideo_subdemux_open(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
DVDVideoDemuxContext *c = s->priv_data;
|
DVDVideoDemuxContext *c = s->priv_data;
|
||||||
|
extern const AVInputFormat ff_mpegps_demuxer;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!(c->mpeg_fmt = av_find_input_format("mpeg")))
|
|
||||||
return AVERROR_DEMUXER_NOT_FOUND;
|
|
||||||
|
|
||||||
if (!(c->mpeg_ctx = avformat_alloc_context()))
|
if (!(c->mpeg_ctx = avformat_alloc_context()))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
@ -1246,7 +1242,7 @@ static int dvdvideo_subdemux_open(AVFormatContext *s)
|
|||||||
c->mpeg_ctx->correct_ts_overflow = 0;
|
c->mpeg_ctx->correct_ts_overflow = 0;
|
||||||
c->mpeg_ctx->io_open = NULL;
|
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)
|
static int dvdvideo_read_header(AVFormatContext *s)
|
||||||
|
Reference in New Issue
Block a user