mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-13 21:26:33 +02:00
matroskaenc: pass the packet size directly as parameter of mkv_blockgroup_size()
Originally committed as revision 15559 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
8401c51407
commit
1bfbe8ff9d
@ -710,9 +710,9 @@ static int mkv_write_header(AVFormatContext *s)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mkv_blockgroup_size(AVPacket *pkt)
|
static int mkv_blockgroup_size(int pkt_size)
|
||||||
{
|
{
|
||||||
int size = pkt->size + 4;
|
int size = pkt_size + 4;
|
||||||
size += ebml_num_size(size);
|
size += ebml_num_size(size);
|
||||||
size += 2; // EBML ID for block and block duration
|
size += 2; // EBML ID for block and block duration
|
||||||
size += 8; // max size of block duration
|
size += 8; // max size of block duration
|
||||||
@ -775,7 +775,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (codec->codec_type != CODEC_TYPE_SUBTITLE) {
|
if (codec->codec_type != CODEC_TYPE_SUBTITLE) {
|
||||||
mkv_write_block(s, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe << 7);
|
mkv_write_block(s, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe << 7);
|
||||||
} else {
|
} else {
|
||||||
ebml_master blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(pkt));
|
ebml_master blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(pkt->size));
|
||||||
duration = pkt->convergence_duration;
|
duration = pkt->convergence_duration;
|
||||||
mkv_write_block(s, MATROSKA_ID_BLOCK, pkt, 0);
|
mkv_write_block(s, MATROSKA_ID_BLOCK, pkt, 0);
|
||||||
put_ebml_uint(pb, MATROSKA_ID_DURATION, duration);
|
put_ebml_uint(pb, MATROSKA_ID_DURATION, duration);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user