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
3263b829
Commit
3263b829
authored
Oct 31, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: create input resource immediately
(instead of waiting for play)
parent
a940e18d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
lib/media_player.c
lib/media_player.c
+10
-11
No files found.
lib/media_player.c
View file @
3263b829
...
...
@@ -486,12 +486,18 @@ libvlc_media_player_new( libvlc_instance_t *instance )
mp
->
state
=
libvlc_NothingSpecial
;
mp
->
p_libvlc_instance
=
instance
;
mp
->
input
.
p_thread
=
NULL
;
mp
->
input
.
p_resource
=
NULL
;
mp
->
input
.
p_resource
=
input_resource_New
(
VLC_OBJECT
(
mp
));
if
(
unlikely
(
mp
->
input
.
p_resource
==
NULL
))
{
vlc_object_release
(
mp
);
return
NULL
;
}
vlc_mutex_init
(
&
mp
->
input
.
lock
);
mp
->
i_refcount
=
1
;
mp
->
p_event_manager
=
libvlc_event_manager_new
(
mp
,
instance
);
if
(
unlikely
(
mp
->
p_event_manager
==
NULL
))
{
input_resource_Release
(
mp
->
input
.
p_resource
);
vlc_object_release
(
mp
);
return
NULL
;
}
...
...
@@ -569,12 +575,8 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
/* No need for lock_input() because no other threads knows us anymore */
if
(
p_mi
->
input
.
p_thread
)
release_input_thread
(
p_mi
,
true
);
if
(
p_mi
->
input
.
p_resource
)
{
input_resource_Terminate
(
p_mi
->
input
.
p_resource
);
input_resource_Release
(
p_mi
->
input
.
p_resource
);
p_mi
->
input
.
p_resource
=
NULL
;
}
input_resource_Terminate
(
p_mi
->
input
.
p_resource
);
input_resource_Release
(
p_mi
->
input
.
p_resource
);
vlc_mutex_destroy
(
&
p_mi
->
input
.
lock
);
libvlc_event_manager_release
(
p_mi
->
p_event_manager
);
...
...
@@ -718,8 +720,6 @@ int libvlc_media_player_play( libvlc_media_player_t *p_mi )
return
-
1
;
}
if
(
!
p_mi
->
input
.
p_resource
)
p_mi
->
input
.
p_resource
=
input_resource_New
(
VLC_OBJECT
(
p_mi
)
);
p_input_thread
=
input_Create
(
p_mi
,
p_mi
->
p_md
->
p_input_item
,
NULL
,
p_mi
->
input
.
p_resource
);
unlock
(
p_mi
);
...
...
@@ -819,8 +819,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi )
libvlc_event_send
(
p_mi
->
p_event_manager
,
&
event
);
}
if
(
p_mi
->
input
.
p_resource
!=
NULL
)
input_resource_Terminate
(
p_mi
->
input
.
p_resource
);
input_resource_Terminate
(
p_mi
->
input
.
p_resource
);
unlock_input
(
p_mi
);
}
...
...
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