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
be6efa20
Commit
be6efa20
authored
Jun 23, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Libvlc: replace media_instance_destroy_and_detach by media_instance_release.
parent
8b356767
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
501 deletions
+43
-501
src/control/media_instance.c
src/control/media_instance.c
+32
-2
src/control/mediacontrol_audio_video.c
src/control/mediacontrol_audio_video.c
+4
-4
src/control/mediacontrol_core.c
src/control/mediacontrol_core.c
+4
-4
src/control/video.c
src/control/video.c
+3
-491
No files found.
src/control/media_instance.c
View file @
be6efa20
...
@@ -83,6 +83,9 @@ libvlc_media_instance_t * libvlc_media_instance_new_from_input_thread(
...
@@ -83,6 +83,9 @@ libvlc_media_instance_t * libvlc_media_instance_new_from_input_thread(
p_mi
->
p_libvlc_instance
=
p_libvlc_instance
;
p_mi
->
p_libvlc_instance
=
p_libvlc_instance
;
p_mi
->
i_input_id
=
p_input
->
i_object_id
;
p_mi
->
i_input_id
=
p_input
->
i_object_id
;
/* will be released in media_instance_release() */
vlc_object_retain
(
p_input
);
return
p_mi
;
return
p_mi
;
}
}
...
@@ -113,13 +116,35 @@ void libvlc_media_instance_destroy( libvlc_media_instance_t *p_mi )
...
@@ -113,13 +116,35 @@ void libvlc_media_instance_destroy( libvlc_media_instance_t *p_mi )
}
}
/**************************************************************************
/**************************************************************************
*
Free a Media Instance object (libvlc internal)
*
Release a Media Instance object
**************************************************************************/
**************************************************************************/
void
libvlc_media_instance_
destroy_and_detach
(
libvlc_media_instance_t
*
p_mi
)
void
libvlc_media_instance_
release
(
libvlc_media_instance_t
*
p_mi
)
{
{
input_thread_t
*
p_input_thread
;
libvlc_exception_t
p_e
;
/* XXX: locking */
libvlc_exception_init
(
&
p_e
);
if
(
!
p_mi
)
if
(
!
p_mi
)
return
;
return
;
p_input_thread
=
libvlc_get_input_thread
(
p_mi
,
&
p_e
);
if
(
!
libvlc_exception_raised
(
&
p_e
)
)
{
/* release for previous libvlc_get_input_thread */
vlc_object_release
(
p_input_thread
);
/* release for initial p_input_thread yield (see _new()) */
vlc_object_release
(
p_input_thread
);
/* No one is tracking this input_thread appart us. Destroy it */
if
(
p_input_thread
->
i_refcount
<=
0
)
input_DestroyThread
(
p_input_thread
);
/* btw, we still have an XXX locking here */
}
libvlc_media_descriptor_destroy
(
p_mi
->
p_md
);
libvlc_media_descriptor_destroy
(
p_mi
->
p_md
);
free
(
p_mi
);
free
(
p_mi
);
...
@@ -145,12 +170,16 @@ void libvlc_media_instance_play( libvlc_media_instance_t *p_mi,
...
@@ -145,12 +170,16 @@ void libvlc_media_instance_play( libvlc_media_instance_t *p_mi,
return
;
return
;
input_Control
(
p_input_thread
,
INPUT_CONTROL_SET_STATE
,
PLAYING_S
);
input_Control
(
p_input_thread
,
INPUT_CONTROL_SET_STATE
,
PLAYING_S
);
vlc_object_release
(
p_input_thread
);
return
;
return
;
}
}
p_input_thread
=
input_CreateThread
(
p_mi
->
p_libvlc_instance
->
p_libvlc_int
,
p_input_thread
=
input_CreateThread
(
p_mi
->
p_libvlc_instance
->
p_libvlc_int
,
p_mi
->
p_md
->
p_input_item
);
p_mi
->
p_md
->
p_input_item
);
p_mi
->
i_input_id
=
p_input_thread
->
i_object_id
;
p_mi
->
i_input_id
=
p_input_thread
->
i_object_id
;
/* will be released in media_instance_release() */
vlc_object_yield
(
p_input_thread
);
}
}
/**************************************************************************
/**************************************************************************
...
@@ -169,6 +198,7 @@ void libvlc_media_instance_pause( libvlc_media_instance_t *p_mi,
...
@@ -169,6 +198,7 @@ void libvlc_media_instance_pause( libvlc_media_instance_t *p_mi,
return
;
return
;
input_Control
(
p_input_thread
,
INPUT_CONTROL_SET_STATE
,
val
);
input_Control
(
p_input_thread
,
INPUT_CONTROL_SET_STATE
,
val
);
vlc_object_release
(
p_input_thread
);
}
}
/**************************************************************************
/**************************************************************************
...
...
src/control/mediacontrol_audio_video.c
View file @
be6efa20
...
@@ -294,7 +294,7 @@ mediacontrol_get_rate( mediacontrol_Instance *self,
...
@@ -294,7 +294,7 @@ mediacontrol_get_rate( mediacontrol_Instance *self,
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
i_ret
=
libvlc_media_instance_get_rate
(
p_mi
,
&
ex
);
i_ret
=
libvlc_media_instance_get_rate
(
p_mi
,
&
ex
);
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
return
i_ret
/
10
;
return
i_ret
/
10
;
...
@@ -315,7 +315,7 @@ mediacontrol_set_rate( mediacontrol_Instance *self,
...
@@ -315,7 +315,7 @@ mediacontrol_set_rate( mediacontrol_Instance *self,
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
libvlc_media_instance_set_rate
(
p_mi
,
rate
*
10
,
&
ex
);
libvlc_media_instance_set_rate
(
p_mi
,
rate
*
10
,
&
ex
);
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
}
}
...
@@ -334,7 +334,7 @@ mediacontrol_get_fullscreen( mediacontrol_Instance *self,
...
@@ -334,7 +334,7 @@ mediacontrol_get_fullscreen( mediacontrol_Instance *self,
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
i_ret
=
libvlc_get_fullscreen
(
p_mi
,
&
ex
);
i_ret
=
libvlc_get_fullscreen
(
p_mi
,
&
ex
);
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_ZERO
(
&
ex
);
return
i_ret
;
return
i_ret
;
...
@@ -355,6 +355,6 @@ mediacontrol_set_fullscreen( mediacontrol_Instance *self,
...
@@ -355,6 +355,6 @@ mediacontrol_set_fullscreen( mediacontrol_Instance *self,
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
libvlc_set_fullscreen
(
p_mi
,
b_fullscreen
,
&
ex
);
libvlc_set_fullscreen
(
p_mi
,
b_fullscreen
,
&
ex
);
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
}
}
src/control/mediacontrol_core.c
View file @
be6efa20
...
@@ -138,7 +138,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
...
@@ -138,7 +138,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
if
(
an_origin
!=
mediacontrol_AbsolutePosition
)
if
(
an_origin
!=
mediacontrol_AbsolutePosition
)
{
{
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
/* Relative or ModuloPosition make no sense */
/* Relative or ModuloPosition make no sense */
RAISE_NULL
(
mediacontrol_PositionOriginNotSupported
,
RAISE_NULL
(
mediacontrol_PositionOriginNotSupported
,
"Only absolute position is valid."
);
"Only absolute position is valid."
);
...
@@ -155,7 +155,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
...
@@ -155,7 +155,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
{
{
if
(
!
self
->
p_playlist
->
p_input
)
if
(
!
self
->
p_playlist
->
p_input
)
{
{
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
RAISE_NULL
(
mediacontrol_InternalException
,
RAISE_NULL
(
mediacontrol_InternalException
,
"No input"
);
"No input"
);
}
}
...
@@ -164,7 +164,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
...
@@ -164,7 +164,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
a_key
,
a_key
,
pos
);
pos
);
}
}
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
return
retval
;
return
retval
;
}
}
...
@@ -186,7 +186,7 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
...
@@ -186,7 +186,7 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
i_pos
=
mediacontrol_position2microsecond
(
self
->
p_playlist
->
p_input
,
a_position
);
i_pos
=
mediacontrol_position2microsecond
(
self
->
p_playlist
->
p_input
,
a_position
);
libvlc_media_instance_set_time
(
p_mi
,
i_pos
/
1000
,
&
ex
);
libvlc_media_instance_set_time
(
p_mi
,
i_pos
/
1000
,
&
ex
);
libvlc_media_instance_
destroy_and_detach
(
p_mi
);
libvlc_media_instance_
release
(
p_mi
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
HANDLE_LIBVLC_EXCEPTION_VOID
(
&
ex
);
}
}
...
...
src/control/video.c
View file @
be6efa20
This diff is collapsed.
Click to expand it.
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