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
38bb5a54
Commit
38bb5a54
authored
May 09, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg4videoenc: Support negative timestamps.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
282e8d4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
mpeg4videoenc.c
libavcodec/mpeg4videoenc.c
+8
-10
No files found.
libavcodec/mpeg4videoenc.c
View file @
38bb5a54
...
...
@@ -880,7 +880,7 @@ void ff_set_mpeg4_time(MpegEncContext * s){
ff_mpeg4_init_direct_mv
(
s
);
}
else
{
s
->
last_time_base
=
s
->
time_base
;
s
->
time_base
=
s
->
time
/
s
->
avctx
->
time_base
.
den
;
s
->
time_base
=
FFUDIV
(
s
->
time
,
s
->
avctx
->
time_base
.
den
)
;
}
}
...
...
@@ -895,11 +895,12 @@ static void mpeg4_encode_gop_header(MpegEncContext * s){
if
(
s
->
reordered_input_picture
[
1
])
time
=
FFMIN
(
time
,
s
->
reordered_input_picture
[
1
]
->
pts
);
time
=
time
*
s
->
avctx
->
time_base
.
num
;
s
->
last_time_base
=
FFUDIV
(
time
,
s
->
avctx
->
time_base
.
den
);
seconds
=
time
/
s
->
avctx
->
time_base
.
den
;
minutes
=
seconds
/
60
;
seconds
%=
60
;
hours
=
minutes
/
60
;
minutes
%=
60
;
hours
%=
24
;
seconds
=
FFUDIV
(
time
,
s
->
avctx
->
time_base
.
den
)
;
minutes
=
FFUDIV
(
seconds
,
60
);
FFUMOD
(
seconds
,
60
)
;
hours
=
FFUDIV
(
minutes
,
60
);
FFUMOD
(
minutes
,
60
)
;
hours
=
FFUMOD
(
hours
,
24
)
;
put_bits
(
&
s
->
pb
,
5
,
hours
);
put_bits
(
&
s
->
pb
,
6
,
minutes
);
...
...
@@ -909,8 +910,6 @@ static void mpeg4_encode_gop_header(MpegEncContext * s){
put_bits
(
&
s
->
pb
,
1
,
!!
(
s
->
flags
&
CODEC_FLAG_CLOSED_GOP
));
put_bits
(
&
s
->
pb
,
1
,
0
);
//broken link == NO
s
->
last_time_base
=
time
/
s
->
avctx
->
time_base
.
den
;
ff_mpeg4_stuffing
(
&
s
->
pb
);
}
...
...
@@ -1083,9 +1082,8 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
put_bits
(
&
s
->
pb
,
16
,
VOP_STARTCODE
);
/* vop header */
put_bits
(
&
s
->
pb
,
2
,
s
->
pict_type
-
1
);
/* pict type: I = 0 , P = 1 */
assert
(
s
->
time
>=
0
);
time_div
=
s
->
time
/
s
->
avctx
->
time_base
.
den
;
time_mod
=
s
->
time
%
s
->
avctx
->
time_base
.
den
;
time_div
=
FFUDIV
(
s
->
time
,
s
->
avctx
->
time_base
.
den
);
time_mod
=
FFUMOD
(
s
->
time
,
s
->
avctx
->
time_base
.
den
);
time_incr
=
time_div
-
s
->
last_time_base
;
assert
(
time_incr
>=
0
);
while
(
time_incr
--
)
...
...
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