Commit 13c61234 authored by Filippo Carone's avatar Filippo Carone

libvlc: Vout object now released when needed

parent d09a0fbf
......@@ -134,22 +134,12 @@ vlc_bool_t libvlc_input_will_play( libvlc_input_t *p_input,
return VLC_FALSE;
}
if ( !p_input_thread->b_die && !p_input_thread->b_dead )
return VLC_TRUE;
return VLC_FALSE;
}
vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
/* GetVout will raise the exception for us */
if( !p_vout )
if ( !p_input_thread->b_die && !p_input_thread->b_dead )
{
return VLC_FALSE;
vlc_object_release( p_input_thread );
return VLC_TRUE;
}
return VLC_TRUE;
vlc_object_release( p_input_thread );
return VLC_FALSE;
}
......@@ -27,7 +27,7 @@
#include <vlc/vout.h>
#include <vlc/intf.h>
vout_thread_t *GetVout( libvlc_input_t *p_input,
static vout_thread_t *GetVout( libvlc_input_t *p_input,
libvlc_exception_t *p_exception )
{
input_thread_t *p_input_thread;
......@@ -80,6 +80,9 @@ void libvlc_set_fullscreen( libvlc_input_t *p_input, int b_fullscreen,
if( i_ret )
libvlc_exception_raise( p_e,
"Unexpected error while setting fullscreen value" );
vlc_object_release( p_vout1 );
}
int libvlc_get_fullscreen( libvlc_input_t *p_input,
......@@ -122,6 +125,9 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input,
if( i_ret )
libvlc_exception_raise( p_e,
"Unexpected error while setting fullscreen value" );
vlc_object_release( p_vout1 );
}
void
......@@ -182,3 +188,19 @@ int libvlc_video_get_width( libvlc_input_t *p_input,
return p_vout1->i_window_width;
}
vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
/* GetVout will raise the exception for us */
if( !p_vout )
{
return VLC_FALSE;
}
vlc_object_release( p_vout );
return VLC_TRUE;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment