@@ -392,6 +392,11 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
stream->lpcm_header[1] = (st->codecpar->channels - 1) | (j << 4);
stream->lpcm_header[2] = 0x80;
stream->lpcm_align = st->codecpar->channels * 2;
+ } 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 mp2, mp3, pcm_s16be, ac3 or dts.\n");
+ goto fail;
} else {
stream->id = mpa_id++;
}