Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2fb193b1
Commit
2fb193b1
authored
May 17, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vformat/matroskaenc: factorize alpha code in mkv_write_block()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8ffcc826
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
matroskaenc.c
libavformat/matroskaenc.c
+14
-19
No files found.
libavformat/matroskaenc.c
View file @
2fb193b1
...
...
@@ -1146,6 +1146,7 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
int
offset
=
0
,
size
=
pkt
->
size
,
side_data_size
=
0
;
int64_t
ts
=
mkv
->
tracks
[
pkt
->
stream_index
].
write_dts
?
pkt
->
dts
:
pkt
->
pts
;
uint64_t
additional_id
=
0
;
ebml_master
block_group
,
block_additions
,
block_more
;
av_log
(
s
,
AV_LOG_DEBUG
,
"Writing block at offset %"
PRIu64
", size %d, "
"pts %"
PRId64
", dts %"
PRId64
", duration %d, flags %d
\n
"
,
...
...
@@ -1173,16 +1174,20 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
}
if
(
side_data_size
&&
additional_id
==
1
)
{
ebml_master
block_group
,
block_additions
,
block_more
;
block_group
=
start_ebml_master
(
pb
,
MATROSKA_ID_BLOCKGROUP
,
0
);
put_ebml_id
(
pb
,
MATROSKA_ID_BLOCK
);
put_ebml_num
(
pb
,
size
+
4
,
0
);
avio_w8
(
pb
,
0x80
|
(
pkt
->
stream_index
+
1
));
// track number
avio_wb16
(
pb
,
ts
-
mkv
->
cluster_pts
);
avio_w8
(
pb
,
flags
);
avio_write
(
pb
,
data
+
offset
,
size
);
if
(
data
!=
pkt
->
data
)
av_free
(
data
);
blockid
=
MATROSKA_ID_BLOCK
;
}
put_ebml_id
(
pb
,
blockid
);
put_ebml_num
(
pb
,
size
+
4
,
0
);
avio_w8
(
pb
,
0x80
|
(
pkt
->
stream_index
+
1
));
// this assumes stream_index is less than 126
avio_wb16
(
pb
,
ts
-
mkv
->
cluster_pts
);
avio_w8
(
pb
,
flags
);
avio_write
(
pb
,
data
+
offset
,
size
);
if
(
data
!=
pkt
->
data
)
av_free
(
data
);
if
(
side_data_size
&&
additional_id
==
1
)
{
block_additions
=
start_ebml_master
(
pb
,
MATROSKA_ID_BLOCKADDITIONS
,
0
);
block_more
=
start_ebml_master
(
pb
,
MATROSKA_ID_BLOCKMORE
,
0
);
put_ebml_uint
(
pb
,
MATROSKA_ID_BLOCKADDID
,
1
);
...
...
@@ -1193,16 +1198,6 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
end_ebml_master
(
pb
,
block_additions
);
end_ebml_master
(
pb
,
block_group
);
}
else
{
put_ebml_id
(
pb
,
blockid
);
put_ebml_num
(
pb
,
size
+
4
,
0
);
avio_w8
(
pb
,
0x80
|
(
pkt
->
stream_index
+
1
));
// this assumes stream_index is less than 126
avio_wb16
(
pb
,
ts
-
mkv
->
cluster_pts
);
avio_w8
(
pb
,
flags
);
avio_write
(
pb
,
data
+
offset
,
size
);
if
(
data
!=
pkt
->
data
)
av_free
(
data
);
}
}
static
int
srt_get_duration
(
uint8_t
**
buf
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment