Merge commit 'e6ed8668597cfea25dfb350a9b4df7fb2efc1d90'

* commit 'e6ed8668597cfea25dfb350a9b4df7fb2efc1d90':
  flvenc: Write proper cropping for VP6 even if there's no extradata

Conflicts:
	libavformat/flvenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-10-10 12:06:17 +02:00
commit 7acb464f0e
1 changed files with 10 additions and 6 deletions

View File

@ -560,13 +560,17 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
} else { } else {
av_assert1(flags>=0); av_assert1(flags>=0);
avio_w8(pb,flags); avio_w8(pb,flags);
if (enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A) 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); if (enc->extradata_size)
else if (enc->codec_id == AV_CODEC_ID_AAC) avio_w8(pb, enc->extradata[0]);
avio_w8(pb,1); // AAC raw 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) { else if (enc->codec_id == AV_CODEC_ID_H264 || enc->codec_id == AV_CODEC_ID_MPEG4) {
avio_w8(pb,1); // AVC NALU avio_w8(pb, 1); // AVC NALU
avio_wb24(pb,pkt->pts - pkt->dts); avio_wb24(pb, pkt->pts - pkt->dts);
} }
avio_write(pb, data ? data : pkt->data, size); avio_write(pb, data ? data : pkt->data, size);