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
0bf79c2f
Commit
0bf79c2f
authored
Mar 08, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing frame_rate accuracy
Originally committed as revision 1652 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8a7b1b18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
ffm.c
libavformat/ffm.c
+9
-2
No files found.
libavformat/ffm.c
View file @
0bf79c2f
...
@@ -140,6 +140,8 @@ static int ffm_write_header(AVFormatContext *s)
...
@@ -140,6 +140,8 @@ static int ffm_write_header(AVFormatContext *s)
/* list of streams */
/* list of streams */
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
int
gcd
;
st
=
s
->
streams
[
i
];
st
=
s
->
streams
[
i
];
fst
=
av_mallocz
(
sizeof
(
FFMStream
));
fst
=
av_mallocz
(
sizeof
(
FFMStream
));
if
(
!
fst
)
if
(
!
fst
)
...
@@ -156,7 +158,9 @@ static int ffm_write_header(AVFormatContext *s)
...
@@ -156,7 +158,9 @@ static int ffm_write_header(AVFormatContext *s)
/* specific info */
/* specific info */
switch
(
codec
->
codec_type
)
{
switch
(
codec
->
codec_type
)
{
case
CODEC_TYPE_VIDEO
:
case
CODEC_TYPE_VIDEO
:
put_be32
(
pb
,
(
codec
->
frame_rate
*
1000
)
/
FRAME_RATE_BASE
);
gcd
=
av_gcd
(
FRAME_RATE_BASE
,
codec
->
frame_rate
);
put_be32
(
pb
,
FRAME_RATE_BASE
/
gcd
);
put_be32
(
pb
,
codec
->
frame_rate
/
gcd
);
put_be16
(
pb
,
codec
->
width
);
put_be16
(
pb
,
codec
->
width
);
put_be16
(
pb
,
codec
->
height
);
put_be16
(
pb
,
codec
->
height
);
put_be16
(
pb
,
codec
->
gop_size
);
put_be16
(
pb
,
codec
->
gop_size
);
...
@@ -390,6 +394,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
...
@@ -390,6 +394,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
/* read each stream */
/* read each stream */
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
char
rc_eq_buf
[
128
];
char
rc_eq_buf
[
128
];
int
rate
,
scale
;
st
=
av_mallocz
(
sizeof
(
AVStream
));
st
=
av_mallocz
(
sizeof
(
AVStream
));
if
(
!
st
)
if
(
!
st
)
...
@@ -411,7 +416,9 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
...
@@ -411,7 +416,9 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
/* specific info */
/* specific info */
switch
(
codec
->
codec_type
)
{
switch
(
codec
->
codec_type
)
{
case
CODEC_TYPE_VIDEO
:
case
CODEC_TYPE_VIDEO
:
codec
->
frame_rate
=
((
int64_t
)
get_be32
(
pb
)
*
FRAME_RATE_BASE
)
/
1000
;
scale
=
get_be32
(
pb
);
rate
=
get_be32
(
pb
);
codec
->
frame_rate
=
(
rate
*
(
int64_t
)
FRAME_RATE_BASE
)
/
scale
;
codec
->
width
=
get_be16
(
pb
);
codec
->
width
=
get_be16
(
pb
);
codec
->
height
=
get_be16
(
pb
);
codec
->
height
=
get_be16
(
pb
);
codec
->
gop_size
=
get_be16
(
pb
);
codec
->
gop_size
=
get_be16
(
pb
);
...
...
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