diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-23 21:13:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-23 21:13:46 +0200 |
commit | 9340ced47b5b13991619d56c2be86a6604e63f5b (patch) | |
tree | f970969439152f01dc3e92e12a27349874bafc16 | |
parent | d062db788012b94e899008964b93cf01a8389fec (diff) | |
parent | 27d460fe98218d50e73b995ee8e4dd4bc0953c84 (diff) | |
download | ffmpeg-9340ced47b5b13991619d56c2be86a6604e63f5b.tar.gz |
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
Refuse to mux H.264 with fourcc H264 into avi without startcode.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/Makefile | 2 | ||||
-rw-r--r-- | libavformat/avienc.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index b9ef19e39e..c2411ca63c 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -83,7 +83,7 @@ OBJS-$(CONFIG_AST_MUXER) += ast.o astenc.o OBJS-$(CONFIG_AU_DEMUXER) += au.o pcm.o OBJS-$(CONFIG_AU_MUXER) += au.o rawenc.o OBJS-$(CONFIG_AVI_DEMUXER) += avidec.o -OBJS-$(CONFIG_AVI_MUXER) += avienc.o avlanguage.o +OBJS-$(CONFIG_AVI_MUXER) += avienc.o mpegtsenc.o avlanguage.o OBJS-$(CONFIG_AVISYNTH) += avisynth.o OBJS-$(CONFIG_AVM2_MUXER) += swfenc.o swf.o OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 4544a6876b..b6a329d209 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -26,6 +26,7 @@ #include "avi.h" #include "avio_internal.h" #include "riff.h" +#include "mpegts.h" #include "libavformat/avlanguage.h" #include "libavutil/avstring.h" #include "libavutil/intreadwrite.h" @@ -570,6 +571,11 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) AVIStream *avist = s->streams[stream_index]->priv_data; AVCodecContext *enc = s->streams[stream_index]->codec; + if (enc->codec_id == AV_CODEC_ID_H264 && enc->codec_tag == MKTAG('H','2','6','4')) { + int ret = ff_check_h264_startcode(s, s->streams[stream_index], pkt); + if (ret < 0) + return ret; + } av_dlog(s, "dts:%s packet_count:%d stream_index:%d\n", av_ts2str(pkt->dts), avist->packet_count, stream_index); while (enc->block_align == 0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB && avist->packet_count) { |