X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Fmpeg.c;fp=ffmpeg%2Flibavformat%2Fmpeg.c;h=827a3c2c5f8b0a15364100bcddae344495130bea;hp=b153727ac6f96ce1d57a48ac047bb3a020039ab2;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavformat/mpeg.c b/ffmpeg/libavformat/mpeg.c index b153727..827a3c2 100644 --- a/ffmpeg/libavformat/mpeg.c +++ b/ffmpeg/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); @@ -695,7 +696,22 @@ 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); - ret = avformat_open_input(&vobsub->sub_ctx, sub_name, &ff_mpegps_demuxer, NULL); + + if (!(iformat = av_find_input_format("mpeg"))) { + ret = AVERROR_DEMUXER_NOT_FOUND; + goto end; + } + + vobsub->sub_ctx = avformat_alloc_context(); + if (!vobsub->sub_ctx) { + ret = AVERROR(ENOMEM); + goto end; + } + + if ((ret = ff_copy_whitelists(vobsub->sub_ctx, s)) < 0) + goto end; + + 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;