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
07afa46c
Commit
07afa46c
authored
Nov 23, 2003
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use snprintf instead of sprintf
parent
20da59b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
15 deletions
+19
-15
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/timer.cpp
+19
-15
No files found.
modules/gui/wxwindows/timer.cpp
View file @
07afa46c
/*****************************************************************************
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-200
1
VideoLAN
* $Id: timer.cpp,v 1.3
4 2003/10/15 12:24:14 gbazin
Exp $
* Copyright (C) 2000-200
3
VideoLAN
* $Id: timer.cpp,v 1.3
5 2003/11/23 22:29:27 ipkiss
Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -40,7 +40,7 @@
/* Callback prototype */
static
int
PopupMenuCB
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
);
vlc_value_t
old_val
,
vlc_value_t
new_val
,
void
*
param
);
/*****************************************************************************
* Constructor.
...
...
@@ -97,9 +97,9 @@ void Timer::Notify()
/* Update the input */
if
(
p_intf
->
p_sys
->
p_input
==
NULL
)
{
p_intf
->
p_sys
->
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
p_intf
->
p_sys
->
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
/* Show slider */
if
(
p_intf
->
p_sys
->
p_input
)
...
...
@@ -186,26 +186,28 @@ void Timer::Notify()
vlc_value_t
pos
;
char
psz_time
[
OFFSETTOTIME_MAX_SIZE
];
vlc_value_t
time
;
mtime_t
i_seconds
;
mtime_t
i_seconds
;
/* Update the value */
var_Get
(
p_input
,
"position"
,
&
pos
);
if
(
pos
.
f_float
>=
0.0
)
{
p_intf
->
p_sys
->
i_slider_pos
=
(
int
)(
SLIDER_MAX_POS
*
pos
.
f_float
);
p_intf
->
p_sys
->
i_slider_pos
=
(
int
)(
SLIDER_MAX_POS
*
pos
.
f_float
);
p_main_interface
->
slider
->
SetValue
(
p_intf
->
p_sys
->
i_slider_pos
);
p_main_interface
->
slider
->
SetValue
(
p_intf
->
p_sys
->
i_slider_pos
);
var_Get
(
p_intf
->
p_sys
->
p_input
,
"time"
,
&
time
);
i_seconds
=
time
.
i_time
/
1000000
;
sprintf
(
psz_time
,
"%d:%02d:%02d"
,
(
int
)
(
i_seconds
/
(
60
*
60
)),
(
int
)
(
i_seconds
/
60
%
60
),
(
int
)
(
i_seconds
%
60
)
);
snprintf
(
psz_time
,
OFFSETTOTIME_MAX_SIZE
,
"%d:%02d:%02d"
,
(
int
)
(
i_seconds
/
(
60
*
60
)),
(
int
)
(
i_seconds
/
60
%
60
),
(
int
)
(
i_seconds
%
60
)
);
p_main_interface
->
slider_box
->
SetLabel
(
wxU
(
psz_time
)
);
p_main_interface
->
slider_box
->
SetLabel
(
wxU
(
psz_time
)
);
}
}
}
...
...
@@ -266,8 +268,10 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
if
(
p_intf
->
p_sys
->
pf_show_dialog
)
{
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_POPUPMENU
,
new_val
.
b_bool
,
0
);
}
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