X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_playlist.c;h=b2f9bc863f9412250f7b689804d92c6e7fa74ef0;hb=885cb897cfb90465e61c39c1c266891b7e499055;hp=eb89f04c2c9ed4d1283388b127d049d029dc80ba;hpb=e4c9ccbcef39cadaccbad655bc6e36e825bf3dde;p=melted diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index eb89f04..b2f9bc8 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -23,6 +23,7 @@ #include "mlt_playlist.h" #include "mlt_frame.h" +#include #include /** Virtual playlist entry. @@ -93,11 +94,37 @@ mlt_service mlt_playlist_service( mlt_playlist this ) return mlt_producer_service( &this->parent ); } +/** Get the propertues associated to this playlist. +*/ + +mlt_properties mlt_playlist_properties( mlt_playlist this ) +{ + return mlt_producer_properties( &this->parent ); +} + /** Append to the virtual playlist. */ static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer, mlt_timecode in, mlt_timecode out ) { + // Get the fps of the first producer + double fps = mlt_properties_get_double( mlt_playlist_properties( this ), "first_fps" ); + + // If fps is 0 + if ( fps == 0 ) + { + // Inherit it from the producer + fps = mlt_producer_get_fps( producer ); + } + else + { + // Generate a warning for now - the following attempt to fix may fail + fprintf( stderr, "Warning: fps mismatch on playlist producer %d\n", this->count ); + + // It should be safe to impose fps on an image producer, but not necessarily safe for video + mlt_properties_set_double( mlt_producer_properties( producer ), "fps", fps ); + } + // Check that we have room if ( this->count >= this->size ) { @@ -115,6 +142,9 @@ static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer this->count ++; + mlt_properties_set_double( mlt_playlist_properties( this ), "first_fps", fps ); + mlt_properties_set_double( mlt_playlist_properties( this ), "fps", fps ); + return 0; }