diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-22 17:19:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-22 17:19:25 +0100 |
commit | 14bc7aaa860e4d71f4966d4679b3fab547f5e0af (patch) | |
tree | 3028f14a787fcea79dcac7e7d23145e130dee9fd | |
parent | 76f4b117807c30a528539fc5c7a7e35cb288cfcf (diff) | |
download | ffmpeg-14bc7aaa860e4d71f4966d4679b3fab547f5e0af.tar.gz |
Revert "avformat/flvenc: Allow muxing video codecs which are not explicitly supported by the muxer"
This commit has no known use case ATM as there are no unsupported video codecs in flv and could
theoretically be use to generate broken files allthough that would be not entirely easy as
tags/codecs still get sanity checked
This reverts commit 76f4b117807c30a528539fc5c7a7e35cb288cfcf.
-rw-r--r-- | libavformat/flvenc.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 9ee27bf49f..e4717ca5d2 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -336,13 +336,6 @@ static int unsupported_codec(AVFormatContext *s, return AVERROR(ENOSYS); } -static int check_video_codec_tag(int codec_tag) { - if (codec_tag <= 0 || codec_tag > 15) { - return AVERROR(ENOSYS); - } else - return 0; -} - static int flv_write_header(AVFormatContext *s) { int i; @@ -365,7 +358,7 @@ static int flv_write_header(AVFormatContext *s) return AVERROR(EINVAL); } flv->video_enc = enc; - if (check_video_codec_tag(enc->codec_tag) < 0) + if (!ff_codec_get_tag(flv_video_codec_ids, enc->codec_id)) return unsupported_codec(s, "Video", enc->codec_id); if (enc->codec_id == AV_CODEC_ID_MPEG4 || @@ -549,9 +542,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) case AVMEDIA_TYPE_VIDEO: avio_w8(pb, FLV_TAG_TYPE_VIDEO); - flags = enc->codec_tag; - if (check_video_codec_tag(flags) < 0) - return unsupported_codec(s, "Video", enc->codec_id); + flags = ff_codec_get_tag(flv_video_codec_ids, enc->codec_id); flags |= pkt->flags & AV_PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER; break; |