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
3ccc2863
Commit
3ccc2863
authored
Mar 31, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Don't assume the playlist always exists.
parent
45c03700
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
28 deletions
+48
-28
src/input/control.c
src/input/control.c
+7
-4
src/input/es_out.c
src/input/es_out.c
+11
-6
src/input/input.c
src/input/input.c
+30
-18
No files found.
src/input/control.c
View file @
3ccc2863
...
...
@@ -598,13 +598,16 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
static
void
NotifyPlaylist
(
input_thread_t
*
p_input
)
{
playlist_t
*
p_playlist
=
pl_Get
(
p_input
);
if
(
p_playlist
->
b_die
)
/* FIXME: We need to avoid that dependency on the playlist
* because it is a circular dependency:
* ( playlist -> input -> playlist ) */
playlist_t
*
p_playlist
=
vlc_object_find
(
p_input
,
VLC_OBJECT_PLAYLIST
,
FIND_PARENT
);
if
(
!
p_playlist
)
return
;
vlc_object_yield
(
p_playlist
);
var_SetInteger
(
p_playlist
,
"item-change"
,
p_input
->
p
->
input
.
p_item
->
i_id
);
pl_Release
(
p_inpu
t
);
vlc_object_release
(
p_playlis
t
);
}
static
void
UpdateBookmarksOption
(
input_thread_t
*
p_input
)
...
...
src/input/es_out.c
View file @
3ccc2863
...
...
@@ -1680,12 +1680,17 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
}
}
{
playlist_t
*
p_playlist
=
pl_Yield
(
p_sys
->
p_input
);
PL_LOCK
;
p_playlist
->
gc_date
=
mdate
();
vlc_object_signal_unlocked
(
p_playlist
);
PL_UNLOCK
;
pl_Release
(
p_playlist
);
/* FIXME: we don't want to depend on the playlist */
playlist_t
*
p_playlist
=
vlc_object_find
(
p_sys
->
p_input
,
VLC_OBJECT_PLAYLIST
,
FIND_PARENT
);
if
(
p_playlist
)
{
PL_LOCK
;
p_playlist
->
gc_date
=
mdate
();
vlc_object_signal_unlocked
(
p_playlist
);
PL_UNLOCK
;
vlc_object_release
(
p_playlist
);
}
}
return
VLC_SUCCESS
;
...
...
src/input/input.c
View file @
3ccc2863
...
...
@@ -40,10 +40,10 @@
#include <vlc_sout.h>
#include "../stream_output/stream_output.h"
#include <vlc_playlist.h>
#include <vlc_interface.h>
#include <vlc_url.h>
#include <vlc_charset.h>
#include <vlc_playlist.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
...
...
@@ -502,7 +502,15 @@ static int Run( input_thread_t *p_input )
{
/* If we failed, wait before we are killed, and exit */
p_input
->
b_error
=
VLC_TRUE
;
playlist_Signal
(
pl_Get
(
p_input
)
);
/* FIXME: we don't want to depend on the playlist */
playlist_t
*
p_playlist
=
vlc_object_find
(
p_input
,
VLC_OBJECT_PLAYLIST
,
FIND_PARENT
);
if
(
p_playlist
)
{
playlist_Signal
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
Error
(
p_input
);
...
...
@@ -1373,27 +1381,31 @@ static sout_instance_t *SoutFind( vlc_object_t *p_parent, input_item_t *p_item,
if
(
b_keep_sout
)
{
/* Remove the sout from the playlist garbage collector */
playlist_t
*
p_playlist
=
pl_Yield
(
p_parent
);
vlc_mutex_lock
(
&
p_playlist
->
gc_lock
);
p_sout
=
vlc_object_find
(
p_playlist
,
VLC_OBJECT_SOUT
,
FIND_CHILD
);
if
(
p_sout
)
/* FIXME: we don't want to depend on the playlist */
playlist_t
*
p_playlist
=
vlc_object_find
(
p_parent
,
VLC_OBJECT_PLAYLIST
,
FIND_PARENT
);
if
(
p_playlist
)
{
if
(
p_sout
->
p_parent
!=
VLC_OBJECT
(
p_playlist
)
)
vlc_mutex_lock
(
&
p_playlist
->
gc_lock
);
p_sout
=
vlc_object_find
(
p_playlist
,
VLC_OBJECT_SOUT
,
FIND_CHILD
);
if
(
p_sout
)
{
vlc_object_release
(
p_sout
);
p_sout
=
NULL
;
}
else
{
vlc_object_detach
(
p_sout
);
/* Remove it from the GC */
if
(
p_sout
->
p_parent
!=
VLC_OBJECT
(
p_playlist
)
)
{
vlc_object_release
(
p_sout
);
p_sout
=
NULL
;
}
else
{
vlc_object_detach
(
p_sout
);
/* Remove it from the GC */
vlc_object_release
(
p_sout
);
vlc_object_release
(
p_sout
);
}
}
}
vlc_mutex_unlock
(
&
p_playlist
->
gc_lock
);
vlc_mutex_unlock
(
&
p_playlist
->
gc_lock
);
pl_Release
(
p_parent
);
vlc_object_release
(
p_playlist
);
}
}
if
(
pb_sout_keep
)
...
...
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