Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
90bf0f63
Commit
90bf0f63
authored
Oct 24, 2012
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: remove pts workaround
parent
1cc119a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
23 deletions
+1
-23
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+1
-23
No files found.
modules/codec/avcodec/encoder.c
View file @
90bf0f63
...
...
@@ -135,9 +135,6 @@ struct encoder_sys_t
float
f_lumi_masking
,
f_dark_masking
,
f_p_masking
,
f_border_masking
;
int
i_luma_elim
,
i_chroma_elim
;
int
i_aac_profile
;
/* AAC profile to use.*/
/* Used to work around stupid timestamping behaviour in libavcodec */
uint64_t
i_framenum
;
mtime_t
pi_delay_pts
[
MAX_FRAME_DELAY
];
};
static
const
char
*
const
ppsz_enc_options
[]
=
{
...
...
@@ -942,16 +939,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
}
}
frame
.
quality
=
p_sys
->
i_quality
;
/* Ugly work-around for stupid libavcodec behaviour */
p_sys
->
i_framenum
++
;
p_sys
->
pi_delay_pts
[
p_sys
->
i_framenum
%
MAX_FRAME_DELAY
]
=
frame
.
pts
;
frame
.
pts
=
p_sys
->
i_framenum
*
AV_TIME_BASE
*
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
;
frame
.
pts
+=
p_enc
->
fmt_in
.
video
.
i_frame_rate
-
1
;
frame
.
pts
/=
p_enc
->
fmt_in
.
video
.
i_frame_rate
;
/* End work-around */
frame
->
quality
=
p_sys
->
i_quality
;
i_out
=
avcodec_encode_video
(
p_sys
->
p_context
,
p_block
->
p_buffer
,
p_block
->
i_buffer
,
&
frame
);
...
...
@@ -989,16 +977,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
p_sys
->
i_buggy_pts_detect
=
p_sys
->
p_context
->
coded_frame
->
pts
;
p_block
->
i_pts
=
p_sys
->
p_context
->
coded_frame
->
pts
;
/* Ugly work-around for stupid libavcodec behaviour */
{
int64_t
i_framenum
=
p_block
->
i_pts
*
p_enc
->
fmt_in
.
video
.
i_frame_rate
/
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
/
AV_TIME_BASE
;
p_block
->
i_pts
=
p_sys
->
pi_delay_pts
[
i_framenum
%
MAX_FRAME_DELAY
];
}
/* End work-around */
if
(
p_sys
->
p_context
->
coded_frame
->
pict_type
!=
AV_PICTURE_TYPE_I
&&
p_sys
->
p_context
->
coded_frame
->
pict_type
!=
AV_PICTURE_TYPE_P
)
{
...
...
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