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
647d418b
Commit
647d418b
authored
Sep 29, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use audio desync as initial audio-delay value.
parent
46ff41d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
14 deletions
+7
-14
include/vlc_aout.h
include/vlc_aout.h
+0
-3
src/audio_output/dec.c
src/audio_output/dec.c
+0
-7
src/input/input.c
src/input/input.c
+2
-1
src/input/var.c
src/input/var.c
+5
-3
No files found.
include/vlc_aout.h
View file @
647d418b
...
...
@@ -290,9 +290,6 @@ struct aout_input_t
int
i_last_input_rate
;
/* internal caching delay from input */
int
i_pts_delay
;
/* desynchronisation delay request by the user */
int
i_desync
;
};
/** an output stream for the audio output */
...
...
src/audio_output/dec.c
View file @
647d418b
...
...
@@ -155,21 +155,18 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
aout_unlock_input_fifos
(
p_aout
);
aout_unlock_mixer
(
p_aout
);
p_input
->
i_desync
=
var_CreateGetInteger
(
p_this
,
"audio-desync"
)
*
1000
;
p_input_thread
=
(
input_thread_t
*
)
vlc_object_find
(
p_this
,
VLC_OBJECT_INPUT
,
FIND_PARENT
);
if
(
p_input_thread
)
{
p_input
->
i_pts_delay
=
p_input_thread
->
i_pts_delay
;
p_input
->
i_pts_delay
+=
p_input
->
i_desync
;
p_input
->
p_input_thread
=
p_input_thread
;
vlc_object_release
(
p_input_thread
);
}
else
{
p_input
->
i_pts_delay
=
DEFAULT_PTS_DELAY
;
p_input
->
i_pts_delay
+=
p_input
->
i_desync
;
p_input
->
p_input_thread
=
NULL
;
}
...
...
@@ -335,10 +332,6 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
return
0
;
}
/* Apply the desynchronisation requested by the user */
p_buffer
->
start_date
+=
p_input
->
i_desync
;
p_buffer
->
end_date
+=
p_input
->
i_desync
;
if
(
p_buffer
->
start_date
>
mdate
()
+
p_input
->
i_pts_delay
+
AOUT_MAX_ADVANCE_TIME
)
{
...
...
src/input/input.c
View file @
647d418b
...
...
@@ -925,7 +925,8 @@ static void InitTitle( input_thread_t * p_input )
/* If the desynchronisation requested by the user is < 0, we need to
* cache more data. */
var_Get
(
p_input
,
"audio-desync"
,
&
val
);
if
(
val
.
i_int
<
0
)
p_input
->
i_pts_delay
-=
(
val
.
i_int
*
1000
);
if
(
val
.
i_int
<
0
)
p_input
->
i_pts_delay
-=
(
val
.
i_int
*
1000
);
/* Update cr_average depending on the caching */
p_input
->
p
->
input
.
i_cr_average
*=
(
10
*
p_input
->
i_pts_delay
/
200000
);
...
...
src/input/var.c
View file @
647d418b
...
...
@@ -188,7 +188,7 @@ void input_ControlVarInit ( input_thread_t *p_input )
/* Delay */
var_Create
(
p_input
,
"audio-delay"
,
VLC_VAR_TIME
);
val
.
i_time
=
0
;
val
.
i_time
=
INT64_C
(
1000
)
*
var_GetInteger
(
p_input
,
"audio-desync"
)
;
var_Change
(
p_input
,
"audio-delay"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
var_Create
(
p_input
,
"spu-delay"
,
VLC_VAR_TIME
);
val
.
i_time
=
0
;
...
...
@@ -770,15 +770,17 @@ static int EsDelayCallback ( vlc_object_t *p_this, char const *psz_cmd,
if
(
!
strcmp
(
psz_cmd
,
"audio-delay"
)
)
{
/*
Change i_pts_delay to make sure es are decoded in time
*/
if
(
newval
.
i_int
<
0
||
oldval
.
i_int
<
0
)
/*
Change i_pts_delay to make sure es are decoded in time
*/
if
(
newval
.
i_int
<
0
||
oldval
.
i_int
<
0
)
{
p_input
->
i_pts_delay
-=
newval
.
i_int
-
oldval
.
i_int
;
}
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_AUDIO_DELAY
,
&
newval
);
}
else
if
(
!
strcmp
(
psz_cmd
,
"spu-delay"
)
)
{
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_SPU_DELAY
,
&
newval
);
}
return
VLC_SUCCESS
;
}
...
...
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