Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
20e46aaf
Commit
20e46aaf
authored
Jun 04, 2012
by
Clément Bœsch
Committed by
Clément Bœsch
Jun 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: export orphan tmcd track metadata to global format metadata.
parent
1ec23d9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
mov.c
libavformat/mov.c
+37
-0
No files found.
libavformat/mov.c
View file @
20e46aaf
...
@@ -2872,6 +2872,42 @@ static int mov_read_close(AVFormatContext *s)
...
@@ -2872,6 +2872,42 @@ static int mov_read_close(AVFormatContext *s)
return
0
;
return
0
;
}
}
static
int
tmcd_is_referenced
(
AVFormatContext
*
s
,
int
tmcd_id
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
AVStream
*
st
=
s
->
streams
[
i
];
MOVStreamContext
*
sc
=
st
->
priv_data
;
if
(
s
->
streams
[
i
]
->
codec
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
)
continue
;
for
(
j
=
0
;
j
<
sc
->
trefs_count
;
j
++
)
if
(
tmcd_id
==
sc
->
trefs
[
j
])
return
1
;
}
return
0
;
}
/* look for a tmcd track not referenced by any video track, and export it globally */
static
void
export_orphan_timecode
(
AVFormatContext
*
s
)
{
int
i
;
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
AVStream
*
st
=
s
->
streams
[
i
];
if
(
st
->
codec
->
codec_tag
==
MKTAG
(
't'
,
'm'
,
'c'
,
'd'
)
&&
!
tmcd_is_referenced
(
s
,
i
+
1
))
{
AVDictionaryEntry
*
tcr
=
av_dict_get
(
st
->
metadata
,
"timecode"
,
NULL
,
0
);
if
(
tcr
)
{
av_dict_set
(
&
s
->
metadata
,
"timecode"
,
tcr
->
value
,
0
);
break
;
}
}
}
}
static
int
mov_read_header
(
AVFormatContext
*
s
)
static
int
mov_read_header
(
AVFormatContext
*
s
)
{
{
MOVContext
*
mov
=
s
->
priv_data
;
MOVContext
*
mov
=
s
->
priv_data
;
...
@@ -2922,6 +2958,7 @@ static int mov_read_header(AVFormatContext *s)
...
@@ -2922,6 +2958,7 @@ static int mov_read_header(AVFormatContext *s)
av_dict_set
(
&
st
->
metadata
,
"timecode"
,
tcr
->
value
,
0
);
av_dict_set
(
&
st
->
metadata
,
"timecode"
,
tcr
->
value
,
0
);
}
}
}
}
export_orphan_timecode
(
s
);
if
(
mov
->
trex_data
)
{
if
(
mov
->
trex_data
)
{
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
...
...
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