]> git.sesse.net Git - mlt/commitdiff
Fix build errors caused by the (hypothetical) conversion of mlt_position from an...
authordezeroex <dezeroex@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 15 Aug 2005 06:25:37 +0000 (06:25 +0000)
committerdezeroex <dezeroex@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 15 Aug 2005 06:25:37 +0000 (06:25 +0000)
preserving original behavior.

git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@800 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_frame.c
src/framework/mlt_playlist.c
src/framework/mlt_playlist.h
src/framework/mlt_producer.c
src/framework/mlt_property.c
src/framework/mlt_types.h

index 0f54d4dfbae552235175f04059cc62f20c95166e..914ef854b7f808de8deaa031e5d7cb0e22811b31 100644 (file)
@@ -1021,6 +1021,7 @@ int mlt_frame_mix_audio( mlt_frame this, mlt_frame that, float weight_start, flo
        return ret;
 }
 
+/* Will this break when mlt_position is converted to double? -Zach */
 int mlt_sample_calculator( float fps, int frequency, int64_t position )
 {
        int samples = 0;
index dac8c6d18e2b4f757c42cff840a05420e748943a..8097fc4b4d65c168b6013f01866837021a1f9b12 100644 (file)
@@ -363,7 +363,7 @@ static mlt_service mlt_playlist_virtual_seek( mlt_playlist this, int *progressiv
        {
                int count = this->list[ i ]->frame_count / this->list[ i ]->repeat;
                *progressive = count == 1;
-               mlt_producer_seek( producer, position % count );
+               mlt_producer_seek( producer, (int)position % count );
        }
        else if ( !strcmp( eof, "pause" ) && total > 0 )
        {
@@ -372,7 +372,7 @@ static mlt_service mlt_playlist_virtual_seek( mlt_playlist this, int *progressiv
                mlt_producer this_producer = MLT_PLAYLIST_PRODUCER( this );
                mlt_producer_seek( this_producer, original - 1 );
                producer = entry->producer;
-               mlt_producer_seek( producer, entry->frame_out % count );
+               mlt_producer_seek( producer, (int)entry->frame_out % count );
                mlt_producer_set_speed( this_producer, 0 );
                mlt_producer_set_speed( producer, 0 );
                *progressive = count == 1;
@@ -1035,7 +1035,7 @@ mlt_producer mlt_playlist_get_clip( mlt_playlist this, int clip )
 /** Return the clip at the specified position.
 */
 
-mlt_producer mlt_playlist_get_clip_at( mlt_playlist this, int position )
+mlt_producer mlt_playlist_get_clip_at( mlt_playlist this, mlt_position position )
 {
        int index = 0, total = 0;
        return mlt_playlist_locate( this, &position, &index, &total );
@@ -1044,7 +1044,7 @@ mlt_producer mlt_playlist_get_clip_at( mlt_playlist this, int position )
 /** Return the clip index of the specified position.
 */
 
-int mlt_playlist_get_clip_index_at( mlt_playlist this, int position )
+int mlt_playlist_get_clip_index_at( mlt_playlist this, mlt_position position )
 {
        int index = 0, total = 0;
        mlt_playlist_locate( this, &position, &index, &total );
@@ -1208,7 +1208,7 @@ int mlt_playlist_is_blank( mlt_playlist this, int clip )
 /** Determine if the specified position is a blank.
 */
 
-int mlt_playlist_is_blank_at( mlt_playlist this, int position )
+int mlt_playlist_is_blank_at( mlt_playlist this, mlt_position position )
 {
        return this == NULL || mlt_producer_is_blank( mlt_playlist_get_clip_at( this, position ) );
 }
@@ -1251,7 +1251,7 @@ void mlt_playlist_insert_blank( mlt_playlist this, int clip, int length )
        }
 }
 
-void mlt_playlist_pad_blanks( mlt_playlist this, int position, int length, int find )
+void mlt_playlist_pad_blanks( mlt_playlist this, mlt_position position, int length, int find )
 {
        if ( this != NULL && length != 0 )
        {
@@ -1278,7 +1278,7 @@ void mlt_playlist_pad_blanks( mlt_playlist this, int position, int length, int f
        }
 }
 
-int mlt_playlist_insert_at( mlt_playlist this, int position, mlt_producer producer, int mode )
+int mlt_playlist_insert_at( mlt_playlist this, mlt_position position, mlt_producer producer, int mode )
 {
        int ret = this == NULL || position < 0 || producer == NULL;
        if ( ret == 0 )
@@ -1376,7 +1376,7 @@ int mlt_playlist_blanks_from( mlt_playlist this, int clip, int bounded )
        return count;
 }
 
-int mlt_playlist_remove_region( mlt_playlist this, int position, int length )
+int mlt_playlist_remove_region( mlt_playlist this, mlt_position position, int length )
 {
        int index = mlt_playlist_get_clip_index_at( this, position );
        if ( index >= 0 && index < this->count )
@@ -1414,7 +1414,7 @@ int mlt_playlist_remove_region( mlt_playlist this, int position, int length )
        return index;
 }
 
-int mlt_playlist_move_region( mlt_playlist this, int position, int length, int new_position )
+int mlt_playlist_move_region( mlt_playlist this, mlt_position position, int length, int new_position )
 {
        if ( this != NULL )
        {
index e70ff623b39201b40a1586ee888de5a77d55a652..27ee8d9cbae6dd30ef5874e8d2631c2291191ff1 100644 (file)
@@ -88,21 +88,21 @@ extern int mlt_playlist_join( mlt_playlist self, int clip, int count, int merge
 extern int mlt_playlist_mix( mlt_playlist self, int clip, int length, mlt_transition transition );
 extern int mlt_playlist_mix_add( mlt_playlist self, int clip, mlt_transition transition );
 extern mlt_producer mlt_playlist_get_clip( mlt_playlist self, int clip );
-extern mlt_producer mlt_playlist_get_clip_at( mlt_playlist self, int position );
-extern int mlt_playlist_get_clip_index_at( mlt_playlist self, int position );
+extern mlt_producer mlt_playlist_get_clip_at( mlt_playlist self, mlt_position position );
+extern int mlt_playlist_get_clip_index_at( mlt_playlist self, mlt_position position );
 extern int mlt_playlist_clip_is_mix( mlt_playlist self, int clip );
 extern void mlt_playlist_consolidate_blanks( mlt_playlist self, int keep_length );
 extern int mlt_playlist_is_blank( mlt_playlist self, int clip );
-extern int mlt_playlist_is_blank_at( mlt_playlist self, int position );
+extern int mlt_playlist_is_blank_at( mlt_playlist self, mlt_position position );
 extern void mlt_playlist_insert_blank( mlt_playlist self, int clip, int length );
-extern void mlt_playlist_pad_blanks( mlt_playlist self, int position, int length, int find );
+extern void mlt_playlist_pad_blanks( mlt_playlist self, mlt_position position, int length, int find );
 extern mlt_producer mlt_playlist_replace_with_blank( mlt_playlist self, int clip );
-extern int mlt_playlist_insert_at( mlt_playlist self, int position, mlt_producer producer, int mode );
+extern int mlt_playlist_insert_at( mlt_playlist self, mlt_position position, mlt_producer producer, int mode );
 extern int mlt_playlist_clip_start( mlt_playlist self, int clip );
 extern int mlt_playlist_clip_length( mlt_playlist self, int clip );
 extern int mlt_playlist_blanks_from( mlt_playlist self, int clip, int bounded );
-extern int mlt_playlist_remove_region( mlt_playlist self, int position, int length );
-extern int mlt_playlist_move_region( mlt_playlist self, int position, int length, int new_position );
+extern int mlt_playlist_remove_region( mlt_playlist self, mlt_position position, int length );
+extern int mlt_playlist_move_region( mlt_playlist self, mlt_position position, int length, int new_position );
 extern void mlt_playlist_close( mlt_playlist self );
 
 #endif
index f137973a5c7ddcc2187fd1f49c2cbabd034c662a..3f7a01b257fce41a05269608f59a6d68d3c3d94b 100644 (file)
@@ -260,7 +260,7 @@ int mlt_producer_seek( mlt_producer this, mlt_position position )
        }
        else if ( use_points && !strcmp( eof, "loop" ) && position >= mlt_producer_get_playtime( this ) )
        {
-               position = position % mlt_producer_get_playtime( this );
+               position = (int)position % (int)mlt_producer_get_playtime( this );
        }
 
        // Set the position
index 63e32a43090bdbff9a2c88a65ee571210d1fd54a..016ea918716d00cba14242b41a3b62ba39eb2ba6 100644 (file)
@@ -269,7 +269,7 @@ char *mlt_property_get_string( mlt_property this )
                {
                        this->types |= mlt_prop_string;
                        this->prop_string = malloc( 32 );
-                       sprintf( this->prop_string, "%d", this->prop_position );
+                       sprintf( this->prop_string, "%d", (int)this->prop_position ); /* I don't know if this is wanted. -Zach */
                }
                else if ( this->types & mlt_prop_int64 )
                {
index c5a8e68feee1691634305df163b6337016041d1b..e9c1743271db526e1045f5641fd81ff23f3668ca 100644 (file)
@@ -65,7 +65,14 @@ typedef enum
 }
 mlt_service_type;
 
+/* I don't want to break anyone's applications without warning. -Zach */
+#undef DOUBLE_MLT_POSITION
+#ifdef DOUBLE_MLT_POSITION
+typedef double mlt_position;
+#else
 typedef int32_t mlt_position;
+#endif
+
 typedef struct mlt_frame_s *mlt_frame, **mlt_frame_ptr;
 typedef struct mlt_properties_s *mlt_properties;
 typedef struct mlt_event_struct *mlt_event;