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
99e22b78
Commit
99e22b78
authored
Apr 21, 2014
by
Miles Gould
Committed by
Luca Barbato
Apr 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: Emit the correct tags for clcp tracks
Bug-Id: 664 Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
802385db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
movenc.c
libavformat/movenc.c
+24
-6
No files found.
libavformat/movenc.c
View file @
99e22b78
...
...
@@ -1295,6 +1295,12 @@ static int mov_write_vmhd_tag(AVIOContext *pb)
return
0x14
;
}
static
int
is_clcp_track
(
MOVTrack
*
track
)
{
return
track
->
tag
==
MKTAG
(
'c'
,
'7'
,
'0'
,
'8'
)
||
track
->
tag
==
MKTAG
(
'c'
,
'6'
,
'0'
,
'8'
);
}
static
int
mov_write_hdlr_tag
(
AVIOContext
*
pb
,
MOVTrack
*
track
)
{
const
char
*
hdlr
,
*
descr
=
NULL
,
*
hdlr_type
=
NULL
;
...
...
@@ -1317,6 +1323,8 @@ static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
hdlr_type
=
"sbtl"
;
}
else
if
(
track
->
tag
==
MKTAG
(
'm'
,
'p'
,
'4'
,
's'
))
{
hdlr_type
=
"subp"
;
}
else
if
(
is_clcp_track
(
track
))
{
hdlr_type
=
"clcp"
;
}
else
{
hdlr_type
=
"text"
;
}
...
...
@@ -1379,8 +1387,11 @@ static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)
else
if
(
track
->
enc
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
mov_write_smhd_tag
(
pb
);
else
if
(
track
->
enc
->
codec_type
==
AVMEDIA_TYPE_SUBTITLE
)
{
if
(
track
->
tag
==
MKTAG
(
't'
,
'e'
,
'x'
,
't'
))
mov_write_gmhd_tag
(
pb
);
else
mov_write_nmhd_tag
(
pb
);
if
(
track
->
tag
==
MKTAG
(
't'
,
'e'
,
'x'
,
't'
)
||
is_clcp_track
(
track
))
{
mov_write_gmhd_tag
(
pb
);
}
else
{
mov_write_nmhd_tag
(
pb
);
}
}
else
if
(
track
->
tag
==
MKTAG
(
'r'
,
't'
,
'p'
,
' '
))
{
mov_write_hmhd_tag
(
pb
);
}
else
if
(
track
->
tag
==
MKTAG
(
't'
,
'm'
,
'c'
,
'd'
))
{
...
...
@@ -1648,7 +1659,8 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov,
ffio_wfourcc
(
pb
,
"trak"
);
mov_write_tkhd_tag
(
pb
,
track
,
st
);
if
(
track
->
mode
==
MODE_PSP
||
track
->
flags
&
MOV_TRACK_CTTS
||
(
track
->
entry
&&
track
->
cluster
[
0
].
dts
))
{
(
track
->
entry
&&
track
->
cluster
[
0
].
dts
)
||
is_clcp_track
(
track
))
{
if
(
!
(
mov
->
flags
&
FF_MOV_FLAG_FRAGMENT
))
mov_write_edts_tag
(
pb
,
track
);
// PSP Movies require edts box
}
...
...
@@ -1659,10 +1671,16 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov,
mov_write_uuid_tag_psp
(
pb
,
track
);
// PSP Movies require this uuid box
if
(
track
->
tag
==
MKTAG
(
'r'
,
't'
,
'p'
,
' '
))
mov_write_udta_sdp
(
pb
,
track
);
if
(
track
->
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
track
->
mode
==
MODE_MOV
)
{
double
sample_aspect_ratio
=
av_q2d
(
st
->
sample_aspect_ratio
);
if
(
0
.
0
!=
sample_aspect_ratio
&&
1
.
0
!=
sample_aspect_ratio
)
if
(
track
->
mode
==
MODE_MOV
)
{
if
(
track
->
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
double
sample_aspect_ratio
=
av_q2d
(
st
->
sample_aspect_ratio
);
if
((
0
.
0
!=
sample_aspect_ratio
&&
1
.
0
!=
sample_aspect_ratio
))
{
mov_write_tapt_tag
(
pb
,
track
);
}
}
if
(
is_clcp_track
(
track
))
{
mov_write_tapt_tag
(
pb
,
track
);
}
}
return
update_size
(
pb
,
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