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
4b8f58ee
Commit
4b8f58ee
authored
Sep 05, 2007
by
David Conrad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write segment UID
Originally committed as revision 10337 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
80380a0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
matroskaenc.c
libavformat/matroskaenc.c
+12
-1
No files found.
libavformat/matroskaenc.c
View file @
4b8f58ee
...
...
@@ -20,6 +20,7 @@
*/
#include "avformat.h"
#include "random.h"
#include "riff.h"
#include "xiph.h"
#include "matroska.h"
...
...
@@ -61,6 +62,8 @@ typedef struct MatroskaMuxContext {
mkv_seekhead
*
main_seekhead
;
mkv_seekhead
*
cluster_seekhead
;
mkv_cues
*
cues
;
AVRandomState
rand_state
;
}
MatroskaMuxContext
;
static
void
put_ebml_id
(
ByteIOContext
*
pb
,
unsigned
int
id
)
...
...
@@ -507,6 +510,9 @@ static int mkv_write_header(AVFormatContext *s)
MatroskaMuxContext
*
mkv
=
s
->
priv_data
;
ByteIOContext
*
pb
=
&
s
->
pb
;
offset_t
ebml_header
,
segment_info
;
int
i
;
av_init_random
(
av_gettime
(),
&
mkv
->
rand_state
);
ebml_header
=
start_ebml_master
(
pb
,
EBML_ID_HEADER
);
put_ebml_uint
(
pb
,
EBML_ID_EBMLVERSION
,
1
);
...
...
@@ -536,11 +542,16 @@ static int mkv_write_header(AVFormatContext *s)
if
(
strlen
(
s
->
title
))
put_ebml_string
(
pb
,
MATROSKA_ID_TITLE
,
s
->
title
);
if
(
!
(
s
->
streams
[
0
]
->
codec
->
flags
&
CODEC_FLAG_BITEXACT
))
{
uint8_t
segmentuid
[
16
];
for
(
i
=
0
;
i
<
16
;
i
++
)
segmentuid
[
i
]
=
av_random
(
&
mkv
->
rand_state
);
put_ebml_string
(
pb
,
MATROSKA_ID_MUXINGAPP
,
LIBAVFORMAT_IDENT
);
put_ebml_string
(
pb
,
MATROSKA_ID_WRITINGAPP
,
LIBAVFORMAT_IDENT
);
put_ebml_date
(
pb
,
MATROSKA_ID_DATEUTC
,
av_gettime
()
);
put_ebml_binary
(
pb
,
MATROSKA_ID_SEGMENTUID
,
segmentuid
,
16
);
}
// XXX: segment UID
// reserve space for the duration
mkv
->
duration
=
0
;
mkv
->
duration_offset
=
url_ftell
(
pb
);
...
...
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