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
aca0f781
Commit
aca0f781
authored
Aug 03, 2012
by
Clément Bœsch
Committed by
Clément Bœsch
Aug 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/movenc: add frame rate heuristic for timecode frame rate.
Fixes ticket 1576.
parent
4b365b08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
movenc.c
libavformat/movenc.c
+9
-1
No files found.
libavformat/movenc.c
View file @
aca0f781
...
...
@@ -3292,6 +3292,7 @@ static void mov_create_chapter_track(AVFormatContext *s, int tracknum)
static
int
mov_create_timecode_track
(
AVFormatContext
*
s
,
int
index
,
int
src_index
,
const
char
*
tcstr
)
{
int
ret
;
MOVMuxContext
*
mov
=
s
->
priv_data
;
MOVTrack
*
track
=
&
mov
->
tracks
[
index
];
AVStream
*
src_st
=
s
->
streams
[
src_index
];
...
...
@@ -3299,8 +3300,15 @@ static int mov_create_timecode_track(AVFormatContext *s, int index, int src_inde
AVPacket
pkt
=
{.
stream_index
=
index
,
.
flags
=
AV_PKT_FLAG_KEY
,
.
size
=
4
};
AVRational
rate
=
{
src_st
->
codec
->
time_base
.
den
,
src_st
->
codec
->
time_base
.
num
};
/* if the codec time base makes no sense, try to fallback on stream frame rate */
if
(
av_timecode_check_frame_rate
(
rate
)
<
0
)
{
av_log
(
s
,
AV_LOG_DEBUG
,
"timecode: tbc=%d/%d invalid, fallback on %d/%d
\n
"
,
rate
.
num
,
rate
.
den
,
src_st
->
avg_frame_rate
.
num
,
src_st
->
avg_frame_rate
.
den
);
rate
=
src_st
->
avg_frame_rate
;
}
/* compute the frame number */
int
ret
=
av_timecode_init_from_string
(
&
tc
,
rate
,
tcstr
,
s
);
ret
=
av_timecode_init_from_string
(
&
tc
,
rate
,
tcstr
,
s
);
if
(
ret
<
0
)
return
ret
;
...
...
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