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
832404ce
Commit
832404ce
authored
Feb 03, 2009
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exactly compute index byte count
Originally committed as revision 16981 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
5363c43e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
mxfenc.c
libavformat/mxfenc.c
+13
-6
No files found.
libavformat/mxfenc.c
View file @
832404ce
...
...
@@ -929,7 +929,8 @@ static int mxf_write_index_table_segment(AVFormatContext *s)
return
ret
;
}
static
void
mxf_write_partition
(
AVFormatContext
*
s
,
int
bodysid
,
int
indexsid
,
static
void
mxf_write_partition
(
AVFormatContext
*
s
,
int
bodysid
,
int
indexsid
,
unsigned
index_byte_count
,
const
uint8_t
*
key
,
int
write_metadata
)
{
MXFContext
*
mxf
=
s
->
priv_data
;
...
...
@@ -956,8 +957,7 @@ static void mxf_write_partition(AVFormatContext *s, int bodysid, int indexsid,
put_be64
(
pb
,
0
);
// headerByteCount, update later
// indexTable
put_be64
(
pb
,
indexsid
?
19
+
109
+
s
->
nb_streams
*
6
+
mxf
->
edit_units_count
*
(
11
+
(
s
->
nb_streams
-
1
)
*
4
)
:
0
);
// indexByteCount
put_be64
(
pb
,
index_byte_count
);
// indexByteCount
put_be32
(
pb
,
indexsid
);
// indexSID
put_be64
(
pb
,
0
);
// bodyOffset
...
...
@@ -1199,7 +1199,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
}
if
(
!
mxf
->
header_written
)
{
mxf_write_partition
(
s
,
1
,
0
,
header_open_partition_key
,
1
);
mxf_write_partition
(
s
,
1
,
0
,
0
,
header_open_partition_key
,
1
);
mxf
->
header_written
=
1
;
}
...
...
@@ -1244,9 +1244,16 @@ static int mxf_write_footer(AVFormatContext *s)
{
MXFContext
*
mxf
=
s
->
priv_data
;
ByteIOContext
*
pb
=
s
->
pb
;
unsigned
index_byte_count
=
109
+
s
->
nb_streams
*
6
+
mxf
->
edit_units_count
*
(
11
+
(
s
->
nb_streams
-
1
)
*
4
);
// add encoded ber length
index_byte_count
+=
16
+
(
index_byte_count
<
128
?
1
:
(
av_log2
(
index_byte_count
)
>>
3
)
+
2
);
mxf
->
footer_partition_offset
=
url_ftell
(
pb
);
mxf_write_partition
(
s
,
0
,
2
,
footer_partition_key
,
0
);
mxf_write_partition
(
s
,
0
,
2
,
index_byte_count
,
footer_partition_key
,
0
);
mxf_write_index_table_segment
(
s
);
...
...
@@ -1254,7 +1261,7 @@ static int mxf_write_footer(AVFormatContext *s)
if
(
!
url_is_streamed
(
s
->
pb
))
{
url_fseek
(
pb
,
0
,
SEEK_SET
);
mxf_write_partition
(
s
,
1
,
0
,
header_closed_partition_key
,
1
);
mxf_write_partition
(
s
,
1
,
0
,
0
,
header_closed_partition_key
,
1
);
}
ff_audio_interleave_close
(
s
);
...
...
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