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
56bdcd25
Commit
56bdcd25
authored
Feb 21, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ParseExecute: robustify and cleanup
This should fix LP#525278.
parent
4cc00ee3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
26 deletions
+15
-26
modules/control/http/http.c
modules/control/http/http.c
+15
-26
No files found.
modules/control/http/http.c
View file @
56bdcd25
...
@@ -370,7 +370,6 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
...
@@ -370,7 +370,6 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
intf_sys_t
*
p_sys
=
p_args
->
p_intf
->
p_sys
;
intf_sys_t
*
p_sys
=
p_args
->
p_intf
->
p_sys
;
int
i_request
=
p_request
!=
NULL
?
strlen
(
p_request
)
:
0
;
int
i_request
=
p_request
!=
NULL
?
strlen
(
p_request
)
:
0
;
char
*
dst
;
char
*
dst
;
vlc_value_t
val
;
char
position
[
4
];
/* percentage */
char
position
[
4
];
/* percentage */
char
time
[
12
];
/* in seconds */
char
time
[
12
];
/* in seconds */
char
length
[
12
];
/* in seconds */
char
length
[
12
];
/* in seconds */
...
@@ -384,41 +383,31 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
...
@@ -384,41 +383,31 @@ static void ParseExecute( httpd_file_sys_t *p_args, char *p_buffer,
p_sys
->
p_input
=
playlist_CurrentInput
(
p_sys
->
p_playlist
);
p_sys
->
p_input
=
playlist_CurrentInput
(
p_sys
->
p_playlist
);
if
(
p_sys
->
p_input
)
if
(
p_sys
->
p_input
)
{
{
var_Get
(
p_sys
->
p_input
,
"position"
,
&
val
);
snprintf
(
position
,
sizeof
(
position
),
"%d"
,
sprintf
(
position
,
"%d"
,
(
int
)((
val
.
f_float
)
*
100
.
0
));
(
int
)(
var_GetFloat
(
p_sys
->
p_input
,
"position"
)
*
100
.
));
var_Get
(
p_sys
->
p_input
,
"time"
,
&
val
);
snprintf
(
time
,
sizeof
(
time
),
"%"
PRIi64
,
sprintf
(
time
,
"%"
PRIi64
,
(
int64_t
)
val
.
i_time
/
INT64_C
(
1000000
)
);
var_GetTime
(
p_sys
->
p_input
,
"time"
)
/
CLOCK_FREQ
);
var_Get
(
p_sys
->
p_input
,
"length"
,
&
val
);
snprintf
(
length
,
sizeof
(
length
),
"%"
PRIi64
,
sprintf
(
length
,
"%"
PRIi64
,
(
int64_t
)
val
.
i_time
/
INT64_C
(
1000000
)
);
var_GetTime
(
p_sys
->
p_input
,
"length"
)
/
CLOCK_FREQ
);
var_Get
(
p_sys
->
p_input
,
"state"
,
&
val
);
switch
(
var_GetInteger
(
p_sys
->
p_input
,
"state"
)
)
if
(
val
.
i_int
==
PLAYING_S
)
{
{
state
=
"playing"
;
case
PLAYING_S
:
state
=
"playing"
;
break
;
}
case
OPENING_S
:
state
=
"opening/connecting"
;
break
;
else
if
(
val
.
i_int
==
OPENING_S
)
case
PAUSE_S
:
state
=
"paused"
;
break
;
{
default:
state
=
"stop"
;
break
;
state
=
"opening/connecting"
;
}
else
if
(
val
.
i_int
==
PAUSE_S
)
{
state
=
"paused"
;
}
else
{
state
=
"stop"
;
}
}
}
}
else
else
{
{
s
printf
(
position
,
"%d"
,
0
);
s
trcpy
(
position
,
"0"
);
s
printf
(
time
,
"%d"
,
0
);
s
trcpy
(
time
,
"0"
);
s
printf
(
length
,
"%d"
,
0
);
s
trcpy
(
length
,
"0"
);
state
=
"stop"
;
state
=
"stop"
;
}
}
aout_VolumeGet
(
p_sys
->
p_playlist
,
&
i_volume
);
aout_VolumeGet
(
p_sys
->
p_playlist
,
&
i_volume
);
s
printf
(
volume
,
"%d"
,
(
int
)
i_volume
);
s
nprintf
(
volume
,
sizeof
(
volume
)
,
"%d"
,
(
int
)
i_volume
);
p_args
->
vars
=
mvar_New
(
"variables"
,
""
);
p_args
->
vars
=
mvar_New
(
"variables"
,
""
);
mvar_AppendNewVar
(
p_args
->
vars
,
"url_param"
,
mvar_AppendNewVar
(
p_args
->
vars
,
"url_param"
,
...
...
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