From: Michael Niedermayer Date: Thu, 28 Jun 2012 21:57:31 +0000 (+0200) Subject: Merge remote-tracking branch 'qatar/master' X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4453f6b8613b0803246c1a9160c8270ec9de1237;p=ffmpeg Merge remote-tracking branch 'qatar/master' * qatar/master: flv: add support for G.711 doc: git: Add checklist with test steps to perform before pushing flvenc: K&R formatting cosmetics movenc: Add channel layouts for PCM. Conflicts: libavformat/flvenc.c tests/ref/fate/acodec-pcm-s16be tests/ref/fate/acodec-pcm-s24be tests/ref/fate/acodec-pcm-s32be tests/ref/fate/acodec-pcm-s8 Merged-by: Michael Niedermayer --- 4453f6b8613b0803246c1a9160c8270ec9de1237 diff --cc doc/git-howto.texi index 44514537ecb,938e165c1be..12025a5eed5 --- a/doc/git-howto.texi +++ b/doc/git-howto.texi @@@ -346,7 -346,62 +346,55 @@@ git checkout -b svn_23456 $SHA where @var{$SHA1} is the commit hash from the @command{git log} output. + + @chapter pre-push checklist + + Once you have a set of commits that you feel are ready for pushing, + work through the following checklist to doublecheck everything is in + proper order. This list tries to be exhaustive. In case you are just + pushing a typo in a comment, some of the steps may be unnecessary. + Apply your common sense, but if in doubt, err on the side of caution. + + First make sure your Git repository is on a branch that is a direct -descendant of the Libav master branch, which is the only one from which -pushing to Libav is possible. Then run the following command: ++descendant of the FFmpeg master branch, which is the only one from which ++pushing to FFmpeg is possible. Then run the following command: + + @itemize + @item @command{git log --patch --stat origin/master..} + + to make sure that only the commits you want to push are pending, that + the log messages of the commits are correct and descriptive and contain + no cruft from @command{git am} and to doublecheck that the commits you + want to push really only contain the changes they are supposed to contain. + + @item @command{git status} + + to ensure no local changes still need to be committed and that no local + changes may have thrown off the results of your testing. + @end itemize + + Next let the code pass through a full run of our testsuite. Before you do, + the command @command{make fate-rsync} will update the test samples. Changes + to the samples set are not very common and commits depending on samples + changes are delayed for at least 24 hours to allow the new samples to + propagate, so updating it once per day is sufficient. Now execute + + @itemize + @item @command{make distclean} -@item @command{/path/to/libav/configure} ++@item @command{/path/to/ffmpeg/configure} + @item @command{make check} + @end itemize + + While the test suite covers a wide range of possible problems, it is not + a panacea. Do not hesitate to perform any other tests necessary to convince + yourself that the changes you are about to push actually work as expected. + + Also note that every single commit should pass the test suite, not just + the result of a series of patches. So if you have a series of related + commits, run the test suite on every single commit. + -Finally, after pushing, mark all patches as committed on -@url{http://patches.libav.org/,patchwork}. -Sometimes this is not automatically done when a patch has been -slightly modified from the version on the mailing list. -Also update previous incarnations of the patches you push so that -patchwork is not cluttered with cruft. - + @chapter Server Issues -Contact the project admins @email{git@@libav.org} if you have technical +Contact the project admins @email{root@@ffmpeg.org} if you have technical problems with the GIT server. diff --cc libavformat/flvenc.c index c636c66badd,d77507dd620..f6933a7b359 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@@ -19,28 -19,25 +19,28 @@@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/intreadwrite.h" + #include "libavutil/dict.h" #include "libavutil/intfloat.h" ++#include "libavutil/avassert.h" + #include "avc.h" #include "avformat.h" #include "flv.h" #include "internal.h" - #include "avc.h" #include "metadata.h" - #include "libavutil/dict.h" - #include "libavutil/avassert.h" -#undef NDEBUG -#include static const AVCodecTag flv_video_codec_ids[] = { - {CODEC_ID_FLV1, FLV_CODECID_H263 }, - {CODEC_ID_H263, FLV_CODECID_REALH263}, - {CODEC_ID_MPEG4, FLV_CODECID_MPEG4 }, - {CODEC_ID_FLASHSV, FLV_CODECID_SCREEN}, - {CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2}, - {CODEC_ID_VP6F, FLV_CODECID_VP6 }, - {CODEC_ID_VP6, FLV_CODECID_VP6 }, - {CODEC_ID_VP6A, FLV_CODECID_VP6A }, - {CODEC_ID_H264, FLV_CODECID_H264 }, - {CODEC_ID_NONE, 0} + { CODEC_ID_FLV1, FLV_CODECID_H263 }, ++ { CODEC_ID_H263, FLV_CODECID_REALH263 }, ++ { CODEC_ID_MPEG4, FLV_CODECID_MPEG4 }, + { CODEC_ID_FLASHSV, FLV_CODECID_SCREEN }, + { CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2 }, + { CODEC_ID_VP6F, FLV_CODECID_VP6 }, + { CODEC_ID_VP6, FLV_CODECID_VP6 }, ++ { CODEC_ID_VP6A, FLV_CODECID_VP6A }, + { CODEC_ID_H264, FLV_CODECID_H264 }, + { CODEC_ID_NONE, 0 } }; static const AVCodecTag flv_audio_codec_ids[] = { @@@ -356,13 -353,13 +372,13 @@@ static int flv_write_header(AVFormatCon for (i = 0; i < s->nb_streams; i++) { AVCodecContext *enc = s->streams[i]->codec; - if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) { + if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) { int64_t pos; avio_w8(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ? - FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO); + FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO); avio_wb24(pb, 0); // size patched later avio_wb24(pb, 0); // ts - avio_w8(pb, 0); // ts ext + avio_w8(pb, 0); // ts ext avio_wb24(pb, 0); // streamid pos = avio_tell(pb); if (enc->codec_id == CODEC_ID_AAC) { @@@ -399,9 -396,8 +415,8 @@@ static int flv_write_trailer(AVFormatCo AVCodecContext *enc = s->streams[i]->codec; FLVStreamContext *sc = s->streams[i]->priv_data; if (enc->codec_type == AVMEDIA_TYPE_VIDEO && - (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)) { - enc->codec_id == CODEC_ID_H264) ++ (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)) put_avc_eos_tag(pb, sc->last_ts); - } } file_size = avio_tell(pb); @@@ -418,32 -414,35 +433,35 @@@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) { - AVIOContext *pb = s->pb; - AVCodecContext *enc = s->streams[pkt->stream_index]->codec; - FLVContext *flv = s->priv_data; + AVIOContext *pb = s->pb; + AVCodecContext *enc = s->streams[pkt->stream_index]->codec; + FLVContext *flv = s->priv_data; FLVStreamContext *sc = s->streams[pkt->stream_index]->priv_data; unsigned ts; - int size= pkt->size; - uint8_t *data= NULL; + int size = pkt->size; + uint8_t *data = NULL; int flags, flags_size; - // av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n", enc->codec_type, timestamp, size); + // av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n", + // enc->codec_type, timestamp, size); - if(enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F || - enc->codec_id == CODEC_ID_VP6A || enc->codec_id == CODEC_ID_AAC) - flags_size= 2; - else if(enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) - flags_size= 5; + if (enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F || - enc->codec_id == CODEC_ID_AAC) ++ enc->codec_id == CODEC_ID_VP6A || enc->codec_id == CODEC_ID_AAC) + flags_size = 2; - else if (enc->codec_id == CODEC_ID_H264) ++ else if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) + flags_size = 5; else - flags_size= 1; + flags_size = 1; switch (enc->codec_type) { case AVMEDIA_TYPE_VIDEO: avio_w8(pb, FLV_TAG_TYPE_VIDEO); flags = enc->codec_tag; - if(flags == 0) { - av_log(s, AV_LOG_ERROR, "video codec %s not compatible with flv\n", avcodec_get_name(enc->codec_id)); + if (flags == 0) { + av_log(s, AV_LOG_ERROR, - "video codec %X not compatible with flv\n", - enc->codec_id); ++ "video codec %s not compatible with flv\n", ++ avcodec_get_name(enc->codec_id)); return -1; } @@@ -462,22 -461,19 +480,24 @@@ default: return AVERROR(EINVAL); } + - if (enc->codec_id == CODEC_ID_H264) - /* check if extradata looks like MP4 */ + if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) { + /* check if extradata looks like mp4 formated */ - if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) { + if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0) return -1; - } + } else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 && + (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) { + av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n"); + return -1; + } + if (flv->delay == AV_NOPTS_VALUE) flv->delay = -pkt->dts; + if (pkt->dts < -flv->delay) { - av_log(s, AV_LOG_WARNING, "Packets are not in the proper order with " - "respect to DTS\n"); + av_log(s, AV_LOG_WARNING, + "Packets are not in the proper order with respect to DTS\n"); return AVERROR(EINVAL); } @@@ -520,25 -515,26 +539,26 @@@ avio_seek(pb, data_size + 10 - 3, SEEK_CUR); avio_wb32(pb, data_size + 11); } else { - avio_w8(pb,flags); - if (enc->codec_id == CODEC_ID_VP6) - avio_w8(pb,0); - if (enc->codec_id == CODEC_ID_VP6F || enc->codec_id == CODEC_ID_VP6A) - avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0); - else if (enc->codec_id == CODEC_ID_AAC) - avio_w8(pb,1); // AAC raw - else if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) { - avio_w8(pb,1); // AVC NALU - avio_wb24(pb,pkt->pts - pkt->dts); - } + avio_w8(pb,flags); + if (enc->codec_id == CODEC_ID_VP6) - avio_w8(pb, 0); - if (enc->codec_id == CODEC_ID_VP6F) ++ avio_w8(pb,0); ++ if (enc->codec_id == CODEC_ID_VP6F || enc->codec_id == CODEC_ID_VP6A) + avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0); + else if (enc->codec_id == CODEC_ID_AAC) - avio_w8(pb, 1); // AAC raw - else if (enc->codec_id == CODEC_ID_H264) { - avio_w8(pb, 1); // AVC NALU - avio_wb24(pb, pkt->pts - pkt->dts); ++ avio_w8(pb,1); // AAC raw ++ else if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) { ++ avio_w8(pb,1); // AVC NALU ++ avio_wb24(pb,pkt->pts - pkt->dts); + } - avio_write(pb, data ? data : pkt->data, size); + avio_write(pb, data ? data : pkt->data, size); - avio_wb32(pb,size+flags_size+11); // previous tag size - flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration); + avio_wb32(pb, size + flags_size + 11); // previous tag size + flv->duration = FFMAX(flv->duration, + pkt->pts + flv->delay + pkt->duration); } - avio_flush(pb); + avio_flush(pb); av_free(data); return pb->error; diff --cc tests/ref/fate/acodec-pcm-s16be index 1cf04ed45e5,39c3838a89a..6f7222a930a --- a/tests/ref/fate/acodec-pcm-s16be +++ b/tests/ref/fate/acodec-pcm-s16be @@@ -1,4 -1,4 +1,4 @@@ - 8bffa66afe9e17366af11e77882518a0 *tests/data/fate/acodec-pcm-s16be.mov -009a446579dd4cba793723b5e2b93c39 *tests/data/fate/acodec-pcm-s16be.mov -1060097 tests/data/fate/acodec-pcm-s16be.mov ++d00ca427a66be2e33ca8d63bcde41316 *tests/data/fate/acodec-pcm-s16be.mov +1059069 tests/data/fate/acodec-pcm-s16be.mov 64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s16be.out.wav stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 diff --cc tests/ref/fate/acodec-pcm-s24be index d0376a6eafe,20bc4e0f09e..c89e0866308 --- a/tests/ref/fate/acodec-pcm-s24be +++ b/tests/ref/fate/acodec-pcm-s24be @@@ -1,4 -1,4 +1,4 @@@ - e3013cfce9b792acb9d572268012160d *tests/data/fate/acodec-pcm-s24be.mov -de27dae0dff0359d8f39449b17d5607f *tests/data/fate/acodec-pcm-s24be.mov -1589297 tests/data/fate/acodec-pcm-s24be.mov ++5d843e1f56796aae3185016f164b16b7 *tests/data/fate/acodec-pcm-s24be.mov +1588269 tests/data/fate/acodec-pcm-s24be.mov 64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s24be.out.wav stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 diff --cc tests/ref/fate/acodec-pcm-s32be index 656a6b2a61e,302bc1ab04f..f7dbc52d47d --- a/tests/ref/fate/acodec-pcm-s32be +++ b/tests/ref/fate/acodec-pcm-s32be @@@ -1,4 -1,4 +1,4 @@@ - f3ef00480e89c5c791e87b8af1cc167c *tests/data/fate/acodec-pcm-s32be.mov -2db1e7fe92d4006103691a4b59064dc6 *tests/data/fate/acodec-pcm-s32be.mov -2118497 tests/data/fate/acodec-pcm-s32be.mov ++b34c66c56df1b1e75688929cf20670b9 *tests/data/fate/acodec-pcm-s32be.mov +2117473 tests/data/fate/acodec-pcm-s32be.mov 64151e4bcc2b717aa5a8454d424d6a1f *tests/data/fate/acodec-pcm-s32be.out.wav stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 diff --cc tests/ref/fate/acodec-pcm-s8 index cabf004983f,f830d2fb335..247c46c5cc3 --- a/tests/ref/fate/acodec-pcm-s8 +++ b/tests/ref/fate/acodec-pcm-s8 @@@ -1,4 -1,4 +1,4 @@@ - 2c504a4e48c19ea1b0e1705893b771bf *tests/data/fate/acodec-pcm-s8.mov -9ee95a7fff38831a1cad3b49c33e6ed9 *tests/data/fate/acodec-pcm-s8.mov -530897 tests/data/fate/acodec-pcm-s8.mov ++d931dc4fffa2d3398e0f31f97e7d6c3a *tests/data/fate/acodec-pcm-s8.mov +529853 tests/data/fate/acodec-pcm-s8.mov 651d4eb8d98dfcdda96ae6c43d8f156b *tests/data/fate/acodec-pcm-s8.out.wav stddev: 147.89 PSNR: 52.93 MAXDIFF: 255 bytes: 1058400/ 1058400