where @var{$SHA1} is the commit hash from the @command{git log} output.
-descendant of the Libav master branch, which is the only one from which
-pushing to Libav is possible. Then run the following command:
+
+ @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
-@item @command{/path/to/libav/configure}
++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}
-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.
-
++@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.
+
+
@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.
* 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 <assert.h>
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[] = {
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) {
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);
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;
}
default:
return AVERROR(EINVAL);
}
- if (enc->codec_id == CODEC_ID_H264)
- /* check if extradata looks like MP4 */
+
- if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
+ 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 (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);
}
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;