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
fecb04cb
Commit
fecb04cb
authored
Nov 20, 2003
by
Simon Latapie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* http.c: little keep and del functions fix ( don't remove currently
playing playlist item ).
parent
de409e6f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
8 deletions
+33
-8
modules/control/http.c
modules/control/http.c
+33
-8
No files found.
modules/control/http.c
View file @
fecb04cb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* http.c : http mini-server ;)
* http.c : http mini-server ;)
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: http.c,v 1.3
6 2003/11/18 12:32:04 gbazin
Exp $
* $Id: http.c,v 1.3
7 2003/11/20 08:44:30 garf
Exp $
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Laurent Aimar <fenrir@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
...
@@ -1768,8 +1768,9 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
...
@@ -1768,8 +1768,9 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
}
}
case
MVLC_DEL
:
case
MVLC_DEL
:
{
{
int
i_item
,
*
p_items
=
NULL
,
i_nb_items
=
0
;
int
i_item
,
*
p_items
=
NULL
,
i_nb_items
=
0
,
i_current
=
-
1
;
char
item
[
512
],
*
p_parser
=
p_request
;
char
item
[
512
],
*
p_parser
=
p_request
;
vlc_value_t
val
;
/* Get the list of items to delete */
/* Get the list of items to delete */
while
(
(
p_parser
=
while
(
(
p_parser
=
...
@@ -1784,6 +1785,16 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
...
@@ -1784,6 +1785,16 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
i_nb_items
++
;
i_nb_items
++
;
}
}
/* we should not remove an item while it is played by VLC */
var_Get
(
p_sys
->
p_input
,
"state"
,
&
val
);
if
(
val
.
i_int
==
PLAYING_S
)
{
i_current
=
p_sys
->
p_playlist
->
i_index
;
}
else
{
i_current
=
-
1
;
}
/* The items need to be deleted from in reversed order */
/* The items need to be deleted from in reversed order */
if
(
i_nb_items
)
if
(
i_nb_items
)
{
{
...
@@ -1797,10 +1808,13 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
...
@@ -1797,10 +1808,13 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
i_index
=
j
;
i_index
=
j
;
}
}
if
(
p_items
[
i_index
]
!=
i_current
)
{
playlist_Delete
(
p_sys
->
p_playlist
,
playlist_Delete
(
p_sys
->
p_playlist
,
p_items
[
i_index
]
);
p_items
[
i_index
]
);
msg_Dbg
(
p_intf
,
"requested playlist delete: %d"
,
msg_Dbg
(
p_intf
,
"requested playlist delete: %d"
,
p_items
[
i_index
]
);
p_items
[
i_index
]
);
}
p_items
[
i_index
]
=
-
1
;
p_items
[
i_index
]
=
-
1
;
}
}
}
}
...
@@ -1810,9 +1824,10 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
...
@@ -1810,9 +1824,10 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
}
}
case
MVLC_KEEP
:
case
MVLC_KEEP
:
{
{
int
i_item
,
*
p_items
=
NULL
,
i_nb_items
=
0
;
int
i_item
,
*
p_items
=
NULL
,
i_nb_items
=
0
,
i_current
=
-
1
;
char
item
[
512
],
*
p_parser
=
p_request
;
char
item
[
512
],
*
p_parser
=
p_request
;
int
i
,
j
;
int
i
,
j
;
vlc_value_t
val
;
/* Get the list of items to keep */
/* Get the list of items to keep */
while
(
(
p_parser
=
while
(
(
p_parser
=
...
@@ -1827,6 +1842,16 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
...
@@ -1827,6 +1842,16 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
i_nb_items
++
;
i_nb_items
++
;
}
}
/* we should not remove an item while it is played by VLC */
var_Get
(
p_sys
->
p_input
,
"state"
,
&
val
);
if
(
val
.
i_int
==
PLAYING_S
)
{
i_current
=
p_sys
->
p_playlist
->
i_index
;
}
else
{
i_current
=
-
1
;
}
/* The items need to be deleted from in reversed order */
/* The items need to be deleted from in reversed order */
for
(
i
=
p_sys
->
p_playlist
->
i_size
-
1
;
i
>=
0
;
i
--
)
for
(
i
=
p_sys
->
p_playlist
->
i_size
-
1
;
i
>=
0
;
i
--
)
{
{
...
@@ -1835,7 +1860,7 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
...
@@ -1835,7 +1860,7 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
{
{
if
(
p_items
[
j
]
==
i
)
break
;
if
(
p_items
[
j
]
==
i
)
break
;
}
}
if
(
j
==
i_nb_items
)
if
(
(
j
==
i_nb_items
)
&&
(
i
!=
i_current
)
)
{
{
playlist_Delete
(
p_sys
->
p_playlist
,
i
);
playlist_Delete
(
p_sys
->
p_playlist
,
i
);
msg_Dbg
(
p_intf
,
"requested playlist delete: %d"
,
msg_Dbg
(
p_intf
,
"requested playlist delete: %d"
,
...
...
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