mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/rtpdec_asf: Use av_find_input_format() instead of directly linking to the demuxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
39a7ded22d
commit
2ce1054257
|
@ -103,6 +103,8 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
|
||||||
AVDictionary *opts = NULL;
|
AVDictionary *opts = NULL;
|
||||||
int len = strlen(p) * 6 / 8;
|
int len = strlen(p) * 6 / 8;
|
||||||
char *buf = av_mallocz(len);
|
char *buf = av_mallocz(len);
|
||||||
|
AVInputFormat *iformat;
|
||||||
|
|
||||||
av_base64_decode(buf, p, len);
|
av_base64_decode(buf, p, len);
|
||||||
|
|
||||||
if (rtp_asf_fix_header(buf, len) < 0)
|
if (rtp_asf_fix_header(buf, len) < 0)
|
||||||
|
@ -112,6 +114,8 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
|
||||||
if (rt->asf_ctx) {
|
if (rt->asf_ctx) {
|
||||||
avformat_close_input(&rt->asf_ctx);
|
avformat_close_input(&rt->asf_ctx);
|
||||||
}
|
}
|
||||||
|
if (!(iformat = av_find_input_format("asf")))
|
||||||
|
return AVERROR_DEMUXER_NOT_FOUND;
|
||||||
if (!(rt->asf_ctx = avformat_alloc_context()))
|
if (!(rt->asf_ctx = avformat_alloc_context()))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
rt->asf_ctx->pb = &pb;
|
rt->asf_ctx->pb = &pb;
|
||||||
|
@ -122,7 +126,7 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = avformat_open_input(&rt->asf_ctx, "", &ff_asf_demuxer, &opts);
|
ret = avformat_open_input(&rt->asf_ctx, "", iformat, &opts);
|
||||||
av_dict_free(&opts);
|
av_dict_free(&opts);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue