Commit e6ed8668 authored by Martin Storsjö's avatar Martin Storsjö

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

This keeps cropping when remuxing from F4V to FLV.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent be1e1373
...@@ -527,9 +527,13 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -527,9 +527,13 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_wb32(pb, data_size + 11); avio_wb32(pb, data_size + 11);
} else { } else {
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]);
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 avio_w8(pb, 1); // AAC raw
else if (enc->codec_id == AV_CODEC_ID_H264) { else if (enc->codec_id == AV_CODEC_ID_H264) {
avio_w8(pb, 1); // AVC NALU avio_w8(pb, 1); // AVC NALU
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment