diff options
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/wtvenc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c index b82ff0b7a2..a1286ae494 100644 --- a/libavformat/wtvenc.c +++ b/libavformat/wtvenc.c @@ -243,14 +243,15 @@ static void put_videoinfoheader2(AVIOContext *pb, AVStream *st) ff_put_bmp_header(pb, st->codec, ff_codec_bmp_tags, 0, 1); if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO) { + int padding = (st->codec->extradata_size & 3) ? 4 - (st->codec->extradata_size & 3) : 0; /* MPEG2VIDEOINFO */ avio_wl32(pb, 0); - avio_wl32(pb, st->codec->extradata_size); + avio_wl32(pb, st->codec->extradata_size + padding); avio_wl32(pb, -1); avio_wl32(pb, -1); avio_wl32(pb, 0); avio_write(pb, st->codec->extradata, st->codec->extradata_size); - avio_wl64(pb, 0); + ffio_fill(pb, 0, padding); } } |