Run time type identification
[melted] / mlt++ / src / MltPlaylist.cpp
index f81fd6e..88d19f1 100644 (file)
@@ -50,14 +50,18 @@ Playlist::Playlist( ) :
        instance = mlt_playlist_init( );
 }
 
-Playlist::Playlist( Playlist &playlist ) :
-       instance( playlist.get_playlist( ) )
+Playlist::Playlist( Service &producer ) :
+       instance( NULL )
 {
-       inc_ref( );
+       if ( producer.type( ) == playlist_type )
+       {
+               instance = ( mlt_playlist )producer.get_service( );
+               inc_ref( );
+       }
 }
 
-Playlist::Playlist( Producer &producer ) :
-       instance( (mlt_playlist )producer.get_producer( ) )
+Playlist::Playlist( Playlist &playlist ) :
+       instance( playlist.get_playlist( ) )
 {
        inc_ref( );
 }