Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
789f1724
Commit
789f1724
authored
Jun 09, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout_InputPlay: compute current time only once
parent
0ba7d3d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/audio_output/input.c
src/audio_output/input.c
+7
-6
No files found.
src/audio_output/input.c
View file @
789f1724
...
...
@@ -549,13 +549,14 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
start_date
=
aout_FifoNextStart
(
&
p_input
->
mixer
.
fifo
);
aout_unlock_input_fifos
(
p_aout
);
if
(
start_date
!=
0
&&
start_date
<
mdate
()
)
mtime_t
now
=
mdate
();
if
(
start_date
!=
0
&&
start_date
<
now
)
{
/* The decoder is _very_ late. This can only happen if the user
* pauses the stream (or if the decoder is buggy, which cannot
* happen :). */
msg_Warn
(
p_aout
,
"computed PTS is out of range (%"
PRId64
"), "
"clearing out"
,
mdate
()
-
start_date
);
"clearing out"
,
now
-
start_date
);
aout_lock_input_fifos
(
p_aout
);
aout_FifoSet
(
&
p_input
->
mixer
.
fifo
,
0
);
aout_unlock_input_fifos
(
p_aout
);
...
...
@@ -566,12 +567,12 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
start_date
=
0
;
}
if
(
p_buffer
->
i_pts
<
mdate
()
+
AOUT_MIN_PREPARE_TIME
)
if
(
p_buffer
->
i_pts
<
now
+
AOUT_MIN_PREPARE_TIME
)
{
/* The decoder gives us f*cked up PTS. It's its business, but we
* can't present it anyway, so drop the buffer. */
msg_Warn
(
p_aout
,
"PTS is out of range (%"
PRId64
"), dropping buffer"
,
mdate
()
-
p_buffer
->
i_pts
);
now
-
p_buffer
->
i_pts
);
inputDrop
(
p_input
,
p_buffer
);
inputResamplingStop
(
p_input
);
...
...
@@ -629,7 +630,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
*/
mtime_t
drift
=
p_buffer
->
i_pts
-
start_date
;
p_input
->
i_resamp_start_date
=
mdate
()
;
p_input
->
i_resamp_start_date
=
now
;
p_input
->
i_resamp_start_drift
=
(
int
)
drift
;
if
(
drift
>
0
)
...
...
@@ -669,7 +670,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
p_input
->
i_resampling_type
=
AOUT_RESAMPLING_NONE
;
msg_Warn
(
p_aout
,
"resampling stopped after %"
PRIi64
" usec "
"(drift: %"
PRIi64
")"
,
mdate
()
-
p_input
->
i_resamp_start_date
,
now
-
p_input
->
i_resamp_start_date
,
p_buffer
->
i_pts
-
start_date
);
}
else
if
(
abs
(
(
int
)(
p_buffer
->
i_pts
-
start_date
)
)
<
...
...
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