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
77971609
Commit
77971609
authored
Jan 31, 2012
by
Clément Bœsch
Committed by
Clément Bœsch
Feb 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: honor tmcd flags while extracting timecode meta.
parent
bd10f01a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
isom.h
libavformat/isom.h
+1
-0
mov.c
libavformat/mov.c
+9
-3
No files found.
libavformat/isom.h
View file @
77971609
...
...
@@ -128,6 +128,7 @@ typedef struct MOVStreamContext {
uint32_t
palette
[
256
];
int
has_palette
;
int64_t
data_size
;
uint32_t
tmcd_flags
;
///< tmcd track flags
}
MOVStreamContext
;
typedef
struct
MOVContext
{
...
...
libavformat/mov.c
View file @
77971609
...
...
@@ -1381,9 +1381,11 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
st
->
codec
->
height
=
sc
->
height
;
}
else
{
if
(
st
->
codec
->
codec_tag
==
MKTAG
(
't'
,
'm'
,
'c'
,
'd'
))
{
MOVStreamContext
*
tmcd_ctx
=
st
->
priv_data
;
int
val
;
avio_rb32
(
pb
);
/* reserved */
val
=
avio_rb32
(
pb
);
/* flags */
tmcd_ctx
->
tmcd_flags
=
val
;
if
(
val
&
1
)
st
->
codec
->
flags2
|=
CODEC_FLAG2_DROP_FRAME_TIMECODE
;
avio_rb32
(
pb
);
/* time scale */
...
...
@@ -2654,13 +2656,12 @@ finish:
}
static
int
parse_timecode_in_framenum_format
(
AVFormatContext
*
s
,
AVStream
*
st
,
uint32_t
value
)
uint32_t
value
,
int
flags
)
{
AVTimecode
tc
;
char
buf
[
AV_TIMECODE_STR_SIZE
];
AVRational
rate
=
{
st
->
codec
->
time_base
.
den
,
st
->
codec
->
time_base
.
num
};
int
flags
=
st
->
codec
->
flags2
&
CODEC_FLAG2_DROP_FRAME_TIMECODE
?
AV_TIMECODE_FLAG_DROPFRAME
:
0
;
int
ret
=
av_timecode_init
(
&
tc
,
rate
,
flags
,
0
,
s
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -2672,6 +2673,7 @@ static int parse_timecode_in_framenum_format(AVFormatContext *s, AVStream *st,
static
int
mov_read_timecode_track
(
AVFormatContext
*
s
,
AVStream
*
st
)
{
MOVStreamContext
*
sc
=
st
->
priv_data
;
int
flags
=
0
;
int64_t
cur_pos
=
avio_tell
(
sc
->
pb
);
uint32_t
value
;
...
...
@@ -2681,12 +2683,16 @@ static int mov_read_timecode_track(AVFormatContext *s, AVStream *st)
avio_seek
(
sc
->
pb
,
st
->
index_entries
->
pos
,
SEEK_SET
);
value
=
avio_rb32
(
s
->
pb
);
if
(
sc
->
tmcd_flags
&
0x0001
)
flags
|=
AV_TIMECODE_FLAG_DROPFRAME
;
if
(
sc
->
tmcd_flags
&
0x0002
)
flags
|=
AV_TIMECODE_FLAG_24HOURSMAX
;
if
(
sc
->
tmcd_flags
&
0x0004
)
flags
|=
AV_TIMECODE_FLAG_ALLOWNEGATIVE
;
/* Assume Counter flag is set to 1 in tmcd track (even though it is likely
* not the case) and thus assume "frame number format" instead of QT one.
* No sample with tmcd track can be found with a QT timecode at the moment,
* despite what the tmcd track "suggests" (Counter flag set to 0 means QT
* format). */
parse_timecode_in_framenum_format
(
s
,
st
,
value
);
parse_timecode_in_framenum_format
(
s
,
st
,
value
,
flags
);
avio_seek
(
sc
->
pb
,
cur_pos
,
SEEK_SET
);
return
0
;
...
...
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