summaryrefslogtreecommitdiff
path: root/libavformat/mpegenc.c
diff options
context:
space:
mode:
authorGyan Doshi <gyandoshi@gmail.com>2018-02-20 20:42:21 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2019-04-22 21:25:55 +0530
commit6829c3cbe480501725250c62cd1b920a75a44ec7 (patch)
treef8637b21e4696074c80be8d8c89cde92f01f7ab0 /libavformat/mpegenc.c
parent8d3630c5402fdda2889fe4f74f7dcdd50ebca654 (diff)
avformat/mpegenc - reject unsupported audio streams
Only MP1, MP2, MP3, 16-bit PCM_DVD, PCM S16BE, AC3 and DTS audio codecs are supported by the muxer.
Diffstat (limited to 'libavformat/mpegenc.c')
-rw-r--r--libavformat/mpegenc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 1389288b7f..43ebc46e0e 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -407,6 +407,16 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
stream->lpcm_header[2] = 0x80;
stream->id = lpcm_id++;
stream->lpcm_align = st->codecpar->channels * st->codecpar->bits_per_coded_sample / 8;
+ } else if (st->codecpar->codec_id == AV_CODEC_ID_MLP ||
+ st->codecpar->codec_id == AV_CODEC_ID_TRUEHD) {
+ av_log(ctx, AV_LOG_ERROR, "Support for muxing audio codec %s not implemented.\n",
+ avcodec_get_name(st->codecpar->codec_id));
+ return AVERROR_PATCHWELCOME;
+ } else if (st->codecpar->codec_id != AV_CODEC_ID_MP1 &&
+ st->codecpar->codec_id != AV_CODEC_ID_MP2 &&
+ st->codecpar->codec_id != AV_CODEC_ID_MP3) {
+ av_log(ctx, AV_LOG_ERROR, "Unsupported audio codec. Must be one of mp1, mp2, mp3, 16-bit pcm_dvd, pcm_s16be, ac3 or dts.\n");
+ goto fail;
} else {
stream->id = mpa_id++;
}