Commit 2b61ffcd authored by damienf's avatar damienf
Browse files

plugin.cpp: don't mess up custom protocol when combining 2 urls

libvlc.c: VLC_IsPlaying(), use playlist_IsPlaying() as last resort
parent 708aea1e
...@@ -569,7 +569,7 @@ HRESULT VLCPlugin::onLoad(void) ...@@ -569,7 +569,7 @@ HRESULT VLCPlugin::onLoad(void)
if( NULL != abs_url ) if( NULL != abs_url )
{ {
if( SUCCEEDED(UrlCombineW(base_url, _bstr_mrl, abs_url, &len, if( SUCCEEDED(UrlCombineW(base_url, _bstr_mrl, abs_url, &len,
URL_ESCAPE_UNSAFE)) ) URL_ESCAPE_UNSAFE|URL_PLUGGABLE_PROTOCOL)) )
{ {
SysFreeString(_bstr_mrl); SysFreeString(_bstr_mrl);
_bstr_mrl = SysAllocStringLen(abs_url, len); _bstr_mrl = SysAllocStringLen(abs_url, len);
......
...@@ -1319,7 +1319,6 @@ vlc_bool_t VLC_IsPlaying( int i_object ) ...@@ -1319,7 +1319,6 @@ vlc_bool_t VLC_IsPlaying( int i_object )
{ {
playlist_t * p_playlist; playlist_t * p_playlist;
vlc_bool_t b_playing; vlc_bool_t b_playing;
vlc_value_t val;
vlc_t *p_vlc = vlc_current_object( i_object ); vlc_t *p_vlc = vlc_current_object( i_object );
...@@ -1336,14 +1335,18 @@ vlc_bool_t VLC_IsPlaying( int i_object ) ...@@ -1336,14 +1335,18 @@ vlc_bool_t VLC_IsPlaying( int i_object )
if( i_object ) vlc_object_release( p_vlc ); if( i_object ) vlc_object_release( p_vlc );
return VLC_ENOOBJ; return VLC_ENOOBJ;
} }
if( !p_playlist->p_input )
if( p_playlist->p_input )
{ {
if( i_object ) vlc_object_release( p_vlc ); vlc_value_t val;
vlc_object_release( p_playlist ); var_Get( p_playlist->p_input, "state", &val );
return VLC_ENOOBJ; b_playing = ( val.i_int == PLAYING_S );
}
else
{
msg_Dbg(p_vlc, "polling playlist_IsPlaying");
b_playing = playlist_IsPlaying( p_playlist );
} }
var_Get( p_playlist->p_input, "state", &val );
b_playing = ( val.i_int == PLAYING_S );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
if( i_object ) vlc_object_release( p_vlc ); if( i_object ) vlc_object_release( p_vlc );
......
Supports Markdown
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