mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/adtsenc: allow only AAC streams
The ADTS muxer will silently (attempt to) mux any audio stream passed to it. Patch adds a codec check. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
02dba49dd3
commit
96f94624e0
|
@ -99,6 +99,10 @@ static int adts_init(AVFormatContext *s)
|
|||
ADTSContext *adts = s->priv_data;
|
||||
AVCodecParameters *par = s->streams[0]->codecpar;
|
||||
|
||||
if (par->codec_id != AV_CODEC_ID_AAC) {
|
||||
av_log(s, AV_LOG_ERROR, "Only AAC streams can be muxed by the ADTS muxer\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (par->extradata_size > 0)
|
||||
return adts_decode_extradata(s, adts, par->extradata,
|
||||
par->extradata_size);
|
||||
|
|
Loading…
Reference in New Issue