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
dc518a3a
Commit
dc518a3a
authored
Aug 22, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: Refactor subtitle specific parsing in mov_parse_stsd_subtitle
parent
ef196bee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
mov.c
libavformat/mov.c
+17
-8
No files found.
libavformat/mov.c
View file @
dc518a3a
...
...
@@ -1292,6 +1292,20 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
}
}
static
void
mov_parse_stsd_subtitle
(
MOVContext
*
c
,
AVIOContext
*
pb
,
AVStream
*
st
,
MOVStreamContext
*
sc
,
int
size
)
{
// ttxt stsd contains display flags, justification, background
// color, fonts, and default styles, so fake an atom to read it
MOVAtom
fake_atom
=
{
.
size
=
size
};
// mp4s contains a regular esds atom
if
(
st
->
codec
->
codec_tag
!=
AV_RL32
(
"mp4s"
))
mov_read_glbl
(
c
,
pb
,
fake_atom
);
st
->
codec
->
width
=
sc
->
width
;
st
->
codec
->
height
=
sc
->
height
;
}
int
ff_mov_read_stsd_entries
(
MOVContext
*
c
,
AVIOContext
*
pb
,
int
entries
)
{
AVStream
*
st
;
...
...
@@ -1355,14 +1369,9 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
st
->
codec
->
codec_id
=
id
;
mov_parse_stsd_audio
(
c
,
pb
,
st
,
sc
);
}
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_SUBTITLE
){
// ttxt stsd contains display flags, justification, background
// color, fonts, and default styles, so fake an atom to read it
MOVAtom
fake_atom
=
{
.
size
=
size
-
(
avio_tell
(
pb
)
-
start_pos
)
};
if
(
format
!=
AV_RL32
(
"mp4s"
))
// mp4s contains a regular esds atom
mov_read_glbl
(
c
,
pb
,
fake_atom
);
st
->
codec
->
codec_id
=
id
;
st
->
codec
->
width
=
sc
->
width
;
st
->
codec
->
height
=
sc
->
height
;
st
->
codec
->
codec_id
=
id
;
mov_parse_stsd_subtitle
(
c
,
pb
,
st
,
sc
,
size
-
(
avio_tell
(
pb
)
-
start_pos
));
}
else
{
/* other codec type, just skip (rtp, mp4s, tmcd ...) */
avio_skip
(
pb
,
size
-
(
avio_tell
(
pb
)
-
start_pos
));
...
...
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