]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/interface.cpp
Use pl_Release with the right argument.
[vlc] / modules / gui / wince / interface.cpp
index 37cef1fdaa3e68f73c1fdeb9e9cabecc77a863cb..d9c1463f221aa79b387df38c7a50875cbe6fe6e3 100644 (file)
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#define __STDC_CONSTANT_MACROS 1
+#include <inttypes.h>
+
+#include <vlc_common.h>
 #include <vlc_aout.h>
 #include <vlc_vout.h>
 #include <vlc_interface.h>
@@ -634,11 +637,10 @@ void Interface::OnShowDialog( int i_dialog_event )
 
 void Interface::OnPlayStream( void )
 {
-    playlist_t *p_playlist = (playlist_t *)
-        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    playlist_t *p_playlist = pl_Yield( p_intf );
     if( p_playlist == NULL ) return;
 
-    if( p_playlist->i_size && p_playlist->i_enabled )
+    if( p_playlist->i_size )
     {
         vlc_value_t state;
 
@@ -650,7 +652,7 @@ void Interface::OnPlayStream( void )
             /* No stream was playing, start one */
             playlist_Play( p_playlist );
             TogglePlayButton( PLAYING_S );
-            vlc_object_release( p_playlist );
+            pl_Release( p_intf );
             return;
         }
 
@@ -670,14 +672,13 @@ void Interface::OnPlayStream( void )
 
         TogglePlayButton( state.i_int );
         vlc_object_release( p_input );
-        vlc_object_release( p_playlist );
     }
     else
     {
         /* If the playlist is empty, open a file requester instead */
-        vlc_object_release( p_playlist );
         OnShowDialog( ID_FILE_QUICKOPEN );
     }
+    pl_Release( p_intf );
 }
 
 void Interface::TogglePlayButton( int i_playing_status )
@@ -757,10 +758,10 @@ void Interface::OnSliderUpdate( int wp )
             char psz_time[ MSTRTIME_MAX_SIZE ], psz_total[ MSTRTIME_MAX_SIZE ];
             mtime_t i_seconds;
 
-            i_seconds = var_GetTime( p_input, "length" ) / I64C(1000000 );
+            i_seconds = var_GetTime( p_input, "length" ) / INT64_C(1000000 );
             secstotimestr( psz_total, i_seconds );
 
-            i_seconds = var_GetTime( p_input, "time" ) / I64C(1000000 );
+            i_seconds = var_GetTime( p_input, "time" ) / INT64_C(1000000 );
             secstotimestr( psz_time, i_seconds );
 
             SendMessage( hwndLabel, WM_SETTEXT, (WPARAM)1,
@@ -809,33 +810,30 @@ void Interface::VolumeUpdate()
 
 void Interface::OnStopStream( void )
 {
-    playlist_t * p_playlist = (playlist_t *)
-        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    playlist_t * p_playlist = pl_Yield( p_intf );
     if( p_playlist == NULL ) return;
 
     playlist_Stop( p_playlist );
     TogglePlayButton( PAUSE_S );
-    vlc_object_release( p_playlist );
+    pl_Release( p_intf );
 }
 
 void Interface::OnPrevStream( void )
 {
-    playlist_t * p_playlist = (playlist_t *)
-        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    playlist_t * p_playlist = pl_Yield( p_intf );
     if( p_playlist == NULL ) return;
 
     playlist_Prev( p_playlist );
-    vlc_object_release( p_playlist );
+    pl_Release( p_intf );
 }
 
 void Interface::OnNextStream( void )
 {
-    playlist_t * p_playlist = (playlist_t *)
-        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    playlist_t * p_playlist = pl_Yield( p_intf );
     if( p_playlist == NULL ) return;
 
     playlist_Next( p_playlist );
-    vlc_object_release( p_playlist );
+    pl_Release( p_intf );
 }
 
 void Interface::OnSlowStream( void )