summaryrefslogtreecommitdiff
path: root/libavformat/flvenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/flvenc.c')
-rw-r--r--libavformat/flvenc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 1c2077b0b5..922410386e 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -560,13 +560,17 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
} else {
av_assert1(flags>=0);
avio_w8(pb,flags);
- if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A)
- avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0);
- else if (enc->codec_id == AV_CODEC_ID_AAC)
- avio_w8(pb,1); // AAC raw
+ if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A) {
+ if (enc->extradata_size)
+ avio_w8(pb, enc->extradata[0]);
+ else
+ avio_w8(pb, ((FFALIGN(enc->width, 16) - enc->width) << 4) |
+ (FFALIGN(enc->height, 16) - enc->height));
+ } else if (enc->codec_id == AV_CODEC_ID_AAC)
+ avio_w8(pb, 1); // AAC raw
else if (enc->codec_id == AV_CODEC_ID_H264 || enc->codec_id == AV_CODEC_ID_MPEG4) {
- avio_w8(pb,1); // AVC NALU
- avio_wb24(pb,pkt->pts - pkt->dts);
+ avio_w8(pb, 1); // AVC NALU
+ avio_wb24(pb, pkt->pts - pkt->dts);
}
avio_write(pb, data ? data : pkt->data, size);