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
d39ba9a0
Commit
d39ba9a0
authored
May 22, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: switch spu and audio delay variables to integer type
parent
4286e342
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
48 additions
and
47 deletions
+48
-47
lib/audio.c
lib/audio.c
+2
-2
lib/video.c
lib/video.c
+2
-2
modules/control/hotkeys.c
modules/control/hotkeys.c
+8
-7
modules/demux/subtitle.c
modules/demux/subtitle.c
+1
-1
modules/gui/macosx/TrackSynchronization.m
modules/gui/macosx/TrackSynchronization.m
+6
-6
modules/gui/macosx/applescript.m
modules/gui/macosx/applescript.m
+2
-2
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+8
-8
share/lua/intf/modules/httprequests.lua
share/lua/intf/modules/httprequests.lua
+4
-4
src/input/control.c
src/input/control.c
+4
-4
src/input/event.c
src/input/event.c
+2
-2
src/input/input.c
src/input/input.c
+5
-5
src/input/var.c
src/input/var.c
+4
-4
No files found.
lib/audio.c
View file @
d39ba9a0
...
...
@@ -478,7 +478,7 @@ int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi )
int64_t
val
=
0
;
if
(
p_input_thread
!=
NULL
)
{
val
=
var_Get
Time
(
p_input_thread
,
"audio-delay"
);
val
=
var_Get
Integer
(
p_input_thread
,
"audio-delay"
);
vlc_object_release
(
p_input_thread
);
}
return
val
;
...
...
@@ -493,7 +493,7 @@ int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay )
int
ret
=
0
;
if
(
p_input_thread
!=
NULL
)
{
var_Set
Time
(
p_input_thread
,
"audio-delay"
,
i_delay
);
var_Set
Integer
(
p_input_thread
,
"audio-delay"
,
i_delay
);
vlc_object_release
(
p_input_thread
);
}
else
...
...
lib/video.c
View file @
d39ba9a0
...
...
@@ -364,7 +364,7 @@ int64_t libvlc_video_get_spu_delay( libvlc_media_player_t *p_mi )
if
(
p_input_thread
)
{
val
=
var_Get
Time
(
p_input_thread
,
"spu-delay"
);
val
=
var_Get
Integer
(
p_input_thread
,
"spu-delay"
);
vlc_object_release
(
p_input_thread
);
}
else
...
...
@@ -383,7 +383,7 @@ int libvlc_video_set_spu_delay( libvlc_media_player_t *p_mi,
if
(
p_input_thread
)
{
var_Set
Time
(
p_input_thread
,
"spu-delay"
,
i_delay
);
var_Set
Integer
(
p_input_thread
,
"spu-delay"
,
i_delay
);
vlc_object_release
(
p_input_thread
);
ret
=
0
;
}
...
...
modules/control/hotkeys.c
View file @
d39ba9a0
...
...
@@ -450,10 +450,10 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
}
else
{
int64_t
i_current_subdelay
=
var_Get
Time
(
p_input
,
"spu-delay"
);
int64_t
i_current_subdelay
=
var_Get
Integer
(
p_input
,
"spu-delay"
);
int64_t
i_additional_subdelay
=
p_sys
->
subtitle_delaybookmarks
.
i_time_audio
-
p_sys
->
subtitle_delaybookmarks
.
i_time_subtitle
;
int64_t
i_total_subdelay
=
i_current_subdelay
+
i_additional_subdelay
;
var_Set
Time
(
p_input
,
"spu-delay"
,
i_total_subdelay
);
var_Set
Integer
(
p_input
,
"spu-delay"
,
i_total_subdelay
);
ClearChannels
(
p_intf
,
p_vout
);
DisplayMessage
(
p_vout
,
_
(
"Sub sync: corrected %i ms (total delay = %i ms)"
),
(
int
)(
i_additional_subdelay
/
1000
),
...
...
@@ -466,7 +466,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
}
case
ACTIONID_SUBSYNC_RESET
:
{
var_Set
Time
(
p_input
,
"spu-delay"
,
0
);
var_Set
Integer
(
p_input
,
"spu-delay"
,
0
);
ClearChannels
(
p_intf
,
p_vout
);
DisplayMessage
(
p_vout
,
_
(
"Sub sync: delay reset"
)
);
p_sys
->
subtitle_delaybookmarks
.
i_time_audio
=
0
;
...
...
@@ -493,9 +493,9 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
var_FreeList
(
&
list
,
&
list2
);
break
;
}
int64_t
i_delay
=
var_Get
Time
(
p_input
,
"spu-delay"
)
+
diff
;
int64_t
i_delay
=
var_Get
Integer
(
p_input
,
"spu-delay"
)
+
diff
;
var_Set
Time
(
p_input
,
"spu-delay"
,
i_delay
);
var_Set
Integer
(
p_input
,
"spu-delay"
,
i_delay
);
ClearChannels
(
p_intf
,
p_vout
);
DisplayMessage
(
p_vout
,
_
(
"Subtitle delay %i ms"
),
(
int
)(
i_delay
/
1000
)
);
...
...
@@ -509,9 +509,10 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
int
diff
=
(
i_action
==
ACTIONID_AUDIODELAY_UP
)
?
50000
:
-
50000
;
if
(
p_input
)
{
int64_t
i_delay
=
var_GetTime
(
p_input
,
"audio-delay"
)
+
diff
;
int64_t
i_delay
=
var_GetInteger
(
p_input
,
"audio-delay"
)
+
diff
;
var_Set
Time
(
p_input
,
"audio-delay"
,
i_delay
);
var_Set
Integer
(
p_input
,
"audio-delay"
,
i_delay
);
ClearChannels
(
p_intf
,
p_vout
);
DisplayMessage
(
p_vout
,
_
(
"Audio delay %i ms"
),
(
int
)(
i_delay
/
1000
)
);
...
...
modules/demux/subtitle.c
View file @
d39ba9a0
...
...
@@ -695,7 +695,7 @@ static int Demux( demux_t *p_demux )
if
(
p_sys
->
i_subtitle
>=
p_sys
->
i_subtitles
)
return
0
;
i_maxdate
=
p_sys
->
i_next_demux_date
-
var_Get
Time
(
p_demux
->
p_parent
,
"spu-delay"
);;
i_maxdate
=
p_sys
->
i_next_demux_date
-
var_Get
Integer
(
p_demux
->
p_parent
,
"spu-delay"
);;
if
(
i_maxdate
<=
0
&&
p_sys
->
i_subtitle
<
p_sys
->
i_subtitles
)
{
/* Should not happen */
...
...
modules/gui/macosx/TrackSynchronization.m
View file @
d39ba9a0
...
...
@@ -128,8 +128,8 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_intf
);
if
(
p_input
)
{
var_Set
Time
(
p_input
,
"audio-delay"
,
0
.
0
);
var_Set
Time
(
p_input
,
"spu-delay"
,
0
.
0
);
var_Set
Integer
(
p_input
,
"audio-delay"
,
0
.
0
);
var_Set
Integer
(
p_input
,
"spu-delay"
,
0
.
0
);
var_SetFloat
(
p_input
,
"sub-fps"
,
1
.
0
);
[
self
svDurationValueChanged
:
nil
];
vlc_object_release
(
p_input
);
...
...
@@ -141,8 +141,8 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_intf
);
if
(
p_input
)
{
[
o_av_value_fld
setDoubleValue
:
var_Get
Time
(
p_input
,
"audio-delay"
)
/
1000000
.];
[
o_sv_advance_value_fld
setDoubleValue
:
var_Get
Time
(
p_input
,
"spu-delay"
)
/
1000000
.];
[
o_av_value_fld
setDoubleValue
:
var_Get
Integer
(
p_input
,
"audio-delay"
)
/
1000000
.];
[
o_sv_advance_value_fld
setDoubleValue
:
var_Get
Integer
(
p_input
,
"spu-delay"
)
/
1000000
.];
[
o_sv_speed_value_fld
setFloatValue
:
var_GetFloat
(
p_input
,
"sub-fps"
)];
vlc_object_release
(
p_input
);
}
...
...
@@ -161,7 +161,7 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_intf
);
if
(
p_input
)
{
var_Set
Time
(
p_input
,
"audio-delay"
,
[
o_av_value_fld
doubleValue
]
*
1000000
.);
var_Set
Integer
(
p_input
,
"audio-delay"
,
[
o_av_value_fld
doubleValue
]
*
1000000
.);
vlc_object_release
(
p_input
);
}
...
...
@@ -177,7 +177,7 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_intf
);
if
(
p_input
)
{
var_Set
Time
(
p_input
,
"spu-delay"
,
[
o_sv_advance_value_fld
doubleValue
]
*
1000000
.);
var_Set
Integer
(
p_input
,
"spu-delay"
,
[
o_sv_advance_value_fld
doubleValue
]
*
1000000
.);
vlc_object_release
(
p_input
);
}
...
...
modules/gui/macosx/applescript.m
View file @
d39ba9a0
...
...
@@ -215,7 +215,7 @@
if
(
!
p_input
)
return
i_delay
;
i_delay
=
var_Get
Time
(
p_input
,
"audio-delay"
);
i_delay
=
var_Get
Integer
(
p_input
,
"audio-delay"
);
vlc_object_release
(
p_input
);
return
(
i_delay
/
1000
);
...
...
@@ -226,7 +226,7 @@
if
(
!
p_input
)
return
;
var_Set
Time
(
p_input
,
"audio-delay"
,
i_audioDesync
*
1000
);
var_Set
Integer
(
p_input
,
"audio-delay"
,
i_audioDesync
*
1000
);
vlc_object_release
(
p_input
);
}
...
...
modules/gui/qt4/components/extended_panels.cpp
View file @
d39ba9a0
...
...
@@ -1587,10 +1587,10 @@ void SyncControls::update()
int64_t
i_delay
;
if
(
THEMIM
->
getInput
()
)
{
i_delay
=
var_Get
Time
(
THEMIM
->
getInput
(),
"audio-delay"
);
AVSpin
->
setValue
(
(
(
double
)
i_delay
)
/
1000000
);
i_delay
=
var_Get
Time
(
THEMIM
->
getInput
(),
"spu-delay"
);
subsSpin
->
setValue
(
(
(
double
)
i_delay
)
/
1000000
);
i_delay
=
var_Get
Integer
(
THEMIM
->
getInput
(),
"audio-delay"
);
AVSpin
->
setValue
(
(
(
double
)
i_delay
)
/
CLOCK_FREQ
);
i_delay
=
var_Get
Integer
(
THEMIM
->
getInput
(),
"spu-delay"
);
subsSpin
->
setValue
(
(
(
double
)
i_delay
)
/
CLOCK_FREQ
);
subSpeedSpin
->
setValue
(
var_GetFloat
(
THEMIM
->
getInput
(),
"sub-fps"
)
);
subDurationSpin
->
setValue
(
var_InheritFloat
(
p_intf
,
SUBSDELAY_CFG_FACTOR
)
);
}
...
...
@@ -1601,8 +1601,8 @@ void SyncControls::advanceAudio( double f_advance )
{
if
(
THEMIM
->
getInput
()
&&
b_userAction
)
{
int64_t
i_delay
=
f_advance
*
1000000
;
var_Set
Time
(
THEMIM
->
getInput
(),
"audio-delay"
,
i_delay
);
int64_t
i_delay
=
f_advance
*
CLOCK_FREQ
;
var_Set
Integer
(
THEMIM
->
getInput
(),
"audio-delay"
,
i_delay
);
}
}
...
...
@@ -1610,8 +1610,8 @@ void SyncControls::advanceSubs( double f_advance )
{
if
(
THEMIM
->
getInput
()
&&
b_userAction
)
{
int64_t
i_delay
=
f_advance
*
1000000
;
var_Set
Time
(
THEMIM
->
getInput
(),
"spu-delay"
,
i_delay
);
int64_t
i_delay
=
f_advance
*
CLOCK_FREQ
;
var_Set
Integer
(
THEMIM
->
getInput
(),
"spu-delay"
,
i_delay
);
}
}
...
...
share/lua/intf/modules/httprequests.lua
View file @
d39ba9a0
...
...
@@ -163,7 +163,7 @@ processcommands = function ()
elseif
command
==
"audiodelay"
then
if
vlc
.
object
.
input
()
and
val
then
val
=
common
.
us_tonumber
(
val
)
vlc
.
var
.
set
(
vlc
.
object
.
input
(),
"audio-delay"
,
val
)
vlc
.
var
.
set
(
vlc
.
object
.
input
(),
"audio-delay"
,
val
*
1000000
)
end
elseif
command
==
"rate"
then
val
=
common
.
us_tonumber
(
val
)
...
...
@@ -173,7 +173,7 @@ processcommands = function ()
elseif
command
==
"subdelay"
then
if
vlc
.
object
.
input
()
then
val
=
common
.
us_tonumber
(
val
)
vlc
.
var
.
set
(
vlc
.
object
.
input
(),
"spu-delay"
,
val
)
vlc
.
var
.
set
(
vlc
.
object
.
input
(),
"spu-delay"
,
val
*
1000000
)
end
elseif
command
==
"aspectratio"
then
if
vlc
.
object
.
vout
()
then
...
...
@@ -460,9 +460,9 @@ getstatus = function (includecategories)
s
.
time
=
math.floor
(
vlc
.
var
.
get
(
input
,
"time"
)
/
1000000
)
s
.
position
=
vlc
.
var
.
get
(
input
,
"position"
)
s
.
currentplid
=
vlc
.
playlist
.
current
()
s
.
audiodelay
=
vlc
.
var
.
get
(
input
,
"audio-delay"
)
s
.
audiodelay
=
vlc
.
var
.
get
(
input
,
"audio-delay"
)
/
1000000
s
.
rate
=
vlc
.
var
.
get
(
input
,
"rate"
)
s
.
subtitledelay
=
vlc
.
var
.
get
(
input
,
"spu-delay"
)
s
.
subtitledelay
=
vlc
.
var
.
get
(
input
,
"spu-delay"
)
/
1000000
else
s
.
length
=
0
s
.
time
=
0
...
...
src/input/control.c
View file @
d39ba9a0
...
...
@@ -120,21 +120,21 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
case
INPUT_GET_AUDIO_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
var_Get
Time
(
p_input
,
"audio-delay"
);
*
pi_64
=
var_Get
Integer
(
p_input
,
"audio-delay"
);
return
VLC_SUCCESS
;
case
INPUT_GET_SPU_DELAY
:
pi_64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
*
pi_64
=
var_Get
Time
(
p_input
,
"spu-delay"
);
*
pi_64
=
var_Get
Integer
(
p_input
,
"spu-delay"
);
return
VLC_SUCCESS
;
case
INPUT_SET_AUDIO_DELAY
:
i_64
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
return
var_Set
Time
(
p_input
,
"audio-delay"
,
i_64
);
return
var_Set
Integer
(
p_input
,
"audio-delay"
,
i_64
);
case
INPUT_SET_SPU_DELAY
:
i_64
=
(
int64_t
)
va_arg
(
args
,
int64_t
);
return
var_Set
Time
(
p_input
,
"spu-delay"
,
i_64
);
return
var_Set
Integer
(
p_input
,
"spu-delay"
,
i_64
);
case
INPUT_NAV_ACTIVATE
:
case
INPUT_NAV_UP
:
...
...
src/input/event.c
View file @
d39ba9a0
...
...
@@ -102,7 +102,7 @@ void input_SendEventAudioDelay( input_thread_t *p_input, mtime_t i_delay )
{
vlc_value_t
val
;
val
.
i_
time
=
i_delay
;
val
.
i_
int
=
i_delay
;
var_Change
(
p_input
,
"audio-delay"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_AUDIO_DELAY
);
...
...
@@ -112,7 +112,7 @@ void input_SendEventSubtitleDelay( input_thread_t *p_input, mtime_t i_delay )
{
vlc_value_t
val
;
val
.
i_
time
=
i_delay
;
val
.
i_
int
=
i_delay
;
var_Change
(
p_input
,
"spu-delay"
,
VLC_VAR_SETVALUE
,
&
val
,
NULL
);
Trigger
(
p_input
,
INPUT_EVENT_SUBTITLE_DELAY
);
...
...
src/input/input.c
View file @
d39ba9a0
...
...
@@ -952,7 +952,7 @@ static void LoadSubtitles( input_thread_t *p_input )
const
int
i_delay
=
var_CreateGetInteger
(
p_input
,
"sub-delay"
);
if
(
i_delay
!=
0
)
var_Set
Time
(
p_input
,
"spu-delay"
,
(
mtime_t
)
i_delay
*
100000
);
var_Set
Integer
(
p_input
,
"spu-delay"
,
(
mtime_t
)
i_delay
*
100000
);
/* Look for and add subtitle files */
unsigned
i_flags
=
SUB_FORCED
;
...
...
@@ -1076,8 +1076,8 @@ static void UpdatePtsDelay( input_thread_t *p_input )
i_pts_delay
=
0
;
/* Take care of audio/spu delay */
const
mtime_t
i_audio_delay
=
var_Get
Time
(
p_input
,
"audio-delay"
);
const
mtime_t
i_spu_delay
=
var_Get
Time
(
p_input
,
"spu-delay"
);
const
mtime_t
i_audio_delay
=
var_Get
Integer
(
p_input
,
"audio-delay"
);
const
mtime_t
i_spu_delay
=
var_Get
Integer
(
p_input
,
"spu-delay"
);
const
mtime_t
i_extra_delay
=
__MIN
(
i_audio_delay
,
i_spu_delay
);
if
(
i_extra_delay
<
0
)
i_pts_delay
-=
i_extra_delay
;
...
...
@@ -1837,12 +1837,12 @@ static bool Control( input_thread_t *p_input,
break
;
case
INPUT_CONTROL_SET_AUDIO_DELAY
:
input_SendEventAudioDelay
(
p_input
,
val
.
i_
time
);
input_SendEventAudioDelay
(
p_input
,
val
.
i_
int
);
UpdatePtsDelay
(
p_input
);
break
;
case
INPUT_CONTROL_SET_SPU_DELAY
:
input_SendEventSubtitleDelay
(
p_input
,
val
.
i_
time
);
input_SendEventSubtitleDelay
(
p_input
,
val
.
i_
int
);
UpdatePtsDelay
(
p_input
);
break
;
...
...
src/input/var.c
View file @
d39ba9a0
...
...
@@ -186,10 +186,10 @@ void input_ControlVarInit ( input_thread_t *p_input )
var_Change
(
p_input
,
"navigation"
,
VLC_VAR_SETTEXT
,
&
text
,
NULL
);
/* Delay */
var_Create
(
p_input
,
"audio-delay"
,
VLC_VAR_
TIME
);
var_Set
Time
(
p_input
,
"audio-delay"
,
1000
*
var_GetInteger
(
p_input
,
"audio-desync"
)
);
var_Create
(
p_input
,
"spu-delay"
,
VLC_VAR_
TIME
);
var_Create
(
p_input
,
"audio-delay"
,
VLC_VAR_
INTEGER
);
var_Set
Integer
(
p_input
,
"audio-delay"
,
1000
*
var_GetInteger
(
p_input
,
"audio-desync"
)
);
var_Create
(
p_input
,
"spu-delay"
,
VLC_VAR_
INTEGER
);
/* Video ES */
var_Create
(
p_input
,
"video-es"
,
VLC_VAR_INTEGER
|
VLC_VAR_HASCHOICE
);
...
...
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