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
c3a6d179
Commit
c3a6d179
authored
Mar 19, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/avienc: factor write_odml_master() out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5440d4b6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
20 deletions
+29
-20
avienc.c
libavformat/avienc.c
+29
-20
No files found.
libavformat/avienc.c
View file @
c3a6d179
...
@@ -156,6 +156,34 @@ static int avi_write_counters(AVFormatContext *s, int riff_id)
...
@@ -156,6 +156,34 @@ static int avi_write_counters(AVFormatContext *s, int riff_id)
return
0
;
return
0
;
}
}
static
void
write_odml_master
(
AVFormatContext
*
s
,
int
stream_index
)
{
AVIOContext
*
pb
=
s
->
pb
;
AVStream
*
st
=
s
->
streams
[
stream_index
];
AVCodecContext
*
enc
=
st
->
codec
;
AVIStream
*
avist
=
st
->
priv_data
;
unsigned
char
tag
[
5
];
int
j
;
/* Starting to lay out AVI OpenDML master index.
* We want to make it JUNK entry for now, since we'd
* like to get away without making AVI an OpenDML one
* for compatibility reasons. */
avist
->
indexes
.
entry
=
avist
->
indexes
.
ents_allocated
=
0
;
avist
->
indexes
.
indx_start
=
ff_start_tag
(
pb
,
"JUNK"
);
avio_wl16
(
pb
,
4
);
/* wLongsPerEntry */
avio_w8
(
pb
,
0
);
/* bIndexSubType (0 == frame index) */
avio_w8
(
pb
,
0
);
/* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
avio_wl32
(
pb
,
0
);
/* nEntriesInUse (will fill out later on) */
ffio_wfourcc
(
pb
,
avi_stream2fourcc
(
tag
,
stream_index
,
enc
->
codec_type
));
/* dwChunkId */
avio_wl64
(
pb
,
0
);
/* dwReserved[3] */
// avio_wl32(pb, 0); /* Must be 0. */
for
(
j
=
0
;
j
<
AVI_MASTER_INDEX_SIZE
*
2
;
j
++
)
avio_wl64
(
pb
,
0
);
ff_end_tag
(
pb
,
avist
->
indexes
.
indx_start
);
}
static
int
avi_write_header
(
AVFormatContext
*
s
)
static
int
avi_write_header
(
AVFormatContext
*
s
)
{
{
AVIContext
*
avi
=
s
->
priv_data
;
AVIContext
*
avi
=
s
->
priv_data
;
...
@@ -365,26 +393,7 @@ static int avi_write_header(AVFormatContext *s)
...
@@ -365,26 +393,7 @@ static int avi_write_header(AVFormatContext *s)
}
}
if
(
pb
->
seekable
)
{
if
(
pb
->
seekable
)
{
unsigned
char
tag
[
5
];
write_odml_master
(
s
,
i
);
int
j
;
/* Starting to lay out AVI OpenDML master index.
* We want to make it JUNK entry for now, since we'd
* like to get away without making AVI an OpenDML one
* for compatibility reasons. */
avist
->
indexes
.
entry
=
avist
->
indexes
.
ents_allocated
=
0
;
avist
->
indexes
.
indx_start
=
ff_start_tag
(
pb
,
"JUNK"
);
avio_wl16
(
pb
,
4
);
/* wLongsPerEntry */
avio_w8
(
pb
,
0
);
/* bIndexSubType (0 == frame index) */
avio_w8
(
pb
,
0
);
/* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
avio_wl32
(
pb
,
0
);
/* nEntriesInUse (will fill out later on) */
ffio_wfourcc
(
pb
,
avi_stream2fourcc
(
tag
,
i
,
enc
->
codec_type
));
/* dwChunkId */
avio_wl64
(
pb
,
0
);
/* dwReserved[3] */
// avio_wl32(pb, 0); /* Must be 0. */
for
(
j
=
0
;
j
<
AVI_MASTER_INDEX_SIZE
*
2
;
j
++
)
avio_wl64
(
pb
,
0
);
ff_end_tag
(
pb
,
avist
->
indexes
.
indx_start
);
}
}
if
(
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
if
(
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
...
...
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