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
aad737c6
Commit
aad737c6
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/mxfenc: simplify frame rate checks.
parent
82e5c5d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
mxfenc.c
libavformat/mxfenc.c
+12
-10
No files found.
libavformat/mxfenc.c
View file @
aad737c6
...
...
@@ -1683,26 +1683,28 @@ static int mxf_write_header(AVFormatContext *s)
}
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
AVRational
rate
;
AVRational
rate
,
tbc
=
st
->
codec
->
time_base
;
// Default component depth to 8
sc
->
component_depth
=
8
;
if
(
fabs
(
av_q2d
(
st
->
codec
->
time_base
)
-
1
/
25
.
0
)
<
0
.
0001
)
{
mxf
->
timecode_base
=
(
tbc
.
den
+
tbc
.
num
/
2
)
/
tbc
.
num
;
switch
(
mxf
->
timecode_base
)
{
case
25
:
samples_per_frame
=
PAL_samples_per_frame
;
mxf
->
time_base
=
(
AVRational
){
1
,
25
};
mxf
->
timecode_base
=
25
;
}
else
if
(
fabs
(
av_q2d
(
st
->
codec
->
time_base
)
-
1
/
50
.
0
)
<
0
.
0001
)
{
break
;
case
50
:
samples_per_frame
=
PAL_50_samples_per_frame
;
mxf
->
time_base
=
(
AVRational
){
1
,
50
};
mxf
->
timecode_base
=
50
;
}
else
if
(
fabs
(
av_q2d
(
st
->
codec
->
time_base
)
-
1001
/
30000
.
0
)
<
0
.
0001
)
{
break
;
case
30
:
samples_per_frame
=
NTSC_samples_per_frame
;
mxf
->
time_base
=
(
AVRational
){
1001
,
30000
};
mxf
->
timecode_base
=
30
;
}
else
if
(
fabs
(
av_q2d
(
st
->
codec
->
time_base
)
-
1001
/
60000
.
0
)
<
0
.
0001
)
{
break
;
case
60
:
samples_per_frame
=
NTSC_60_samples_per_frame
;
mxf
->
time_base
=
(
AVRational
){
1001
,
60000
};
mxf
->
timecode_base
=
60
;
}
else
{
break
;
default:
av_log
(
s
,
AV_LOG_ERROR
,
"unsupported video frame rate
\n
"
);
return
-
1
;
}
...
...
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