Merge branch 1.0-bugfix
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 16 May 2009 17:07:46 +0000 (20:07 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 16 May 2009 17:07:50 +0000 (20:07 +0300)
modules/gui/qt4/input_manager.cpp
src/playlist/fetcher.c

index 3f3d9d8..c89f5b9 100644 (file)
@@ -883,11 +883,9 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
     CONNECT( this, inputChanged( input_thread_t * ),
              im, setInput( input_thread_t * ) );
 
-    /* emit check if playlist has allready started playing */
-    vlc_value_t val;
-    var_Change( THEPL, "item-current", VLC_VAR_CHOICESCOUNT, &val, NULL );
-
-    IMEvent *event = new IMEvent( ItemChanged_Type, val.i_int);
+    /* emit check if playlist has already started playing */
+    IMEvent *event = new IMEvent( ItemChanged_Type,
+                                  var_GetInteger( THEPL, "item-current" ) );
     customEvent( event );
     delete event;
 }
index 6136d4c..c9384b4 100644 (file)
@@ -69,6 +69,7 @@ playlist_fetcher_t *playlist_fetcher_New( playlist_t *p_playlist )
     if( !p_fetcher )
         return NULL;
 
+    vlc_object_attach( p_fetcher, p_playlist );
     p_fetcher->p_playlist = p_playlist;
     vlc_mutex_init( &p_fetcher->lock );
     vlc_cond_init( &p_fetcher->wait );
@@ -81,7 +82,7 @@ playlist_fetcher_t *playlist_fetcher_New( playlist_t *p_playlist )
                    VLC_THREAD_PRIORITY_LOW ) )
     {
         msg_Err( p_fetcher, "cannot spawn secondary preparse thread" );
-        free( p_fetcher );
+        vlc_object_release( p_fetcher );
         return NULL;
     }