summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-25 16:28:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-25 16:28:41 +0200
commitff03df6475708d86d48f25bfde0f1602916bb429 (patch)
tree574ed4d34eef527c342d0c1ebf5b27e9aac0c5a3 /libavformat/mpeg.c
parent2ce10542570d8be7a74a94cb03b2f182e2cb5ff8 (diff)
avformat/mpeg: Use av_find_input_format() instead of directly linking to the demuxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 369affda0c..e8e1b085c8 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -683,6 +683,7 @@ static int vobsub_read_header(AVFormatContext *s)
int stream_id = -1;
char id[64] = {0};
char alt[MAX_LINE_SIZE] = {0};
+ AVInputFormat *iformat;
sub_name = av_strdup(s->filename);
fname_len = strlen(sub_name);
@@ -696,6 +697,9 @@ static int vobsub_read_header(AVFormatContext *s)
memcpy(ext, !strncmp(ext, "IDX", 3) ? "SUB" : "sub", 3);
av_log(s, AV_LOG_VERBOSE, "IDX/SUB: %s -> %s\n", s->filename, sub_name);
+ if (!(iformat = av_find_input_format("mpeg")))
+ return AVERROR_DEMUXER_NOT_FOUND;
+
vobsub->sub_ctx = avformat_alloc_context();
if (!vobsub->sub_ctx)
return AVERROR(ENOMEM);
@@ -703,7 +707,7 @@ static int vobsub_read_header(AVFormatContext *s)
if ((ret = ff_copy_whitelists(vobsub->sub_ctx, s)) < 0)
goto end;
- ret = avformat_open_input(&vobsub->sub_ctx, sub_name, &ff_mpegps_demuxer, NULL);
+ ret = avformat_open_input(&vobsub->sub_ctx, sub_name, iformat, NULL);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Unable to open %s as MPEG subtitles\n", sub_name);
goto end;