From 8b541300771625c174ade1b1113c19f863633ef6 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Fri, 8 Feb 2008 02:07:15 +0000 Subject: [PATCH] producer_libdv.c: fix test for framerate matching profile git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1064 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/dv/producer_libdv.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/dv/producer_libdv.c b/src/modules/dv/producer_libdv.c index b593b53..3e0db78 100644 --- a/src/modules/dv/producer_libdv.c +++ b/src/modules/dv/producer_libdv.c @@ -22,6 +22,8 @@ #include #include #include +#include + #include #include #include @@ -132,7 +134,7 @@ struct producer_libdv_s static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index ); static void producer_close( mlt_producer parent ); -static int producer_collect_info( producer_libdv this ); +static int producer_collect_info( producer_libdv this, mlt_profile profile ); mlt_producer producer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *filename ) { @@ -175,7 +177,7 @@ mlt_producer producer_libdv_init( mlt_profile profile, mlt_service_type type, co this->fd = open( filename, O_RDONLY ); // Collect info - if ( this->fd == -1 || !producer_collect_info( this ) ) + if ( this->fd == -1 || !producer_collect_info( this, profile ) ) destroy = 1; } @@ -199,7 +201,6 @@ static int read_frame( int fd, uint8_t* frame_buf, int *isPAL ) if ( result ) { *isPAL = ( frame_buf[3] & 0x80 ); - if ( *isPAL ) { int diff = FRAME_SIZE_625_50 - FRAME_SIZE_525_60; @@ -210,7 +211,7 @@ static int read_frame( int fd, uint8_t* frame_buf, int *isPAL ) return result; } -static int producer_collect_info( producer_libdv this ) +static int producer_collect_info( producer_libdv this, mlt_profile profile ) { int valid = 0; @@ -244,8 +245,8 @@ static int producer_collect_info( producer_libdv this ) this->frames_in_file = this->file_size / this->frame_size; // Calculate default in/out points - double fps = this->is_pal ? 25 : 30000.0 / 1001.0; - if ( mlt_producer_get_fps( &this->parent ) == fps ) + int fps = 1000 * ( this->is_pal ? 25 : ( 30000.0 / 1001.0 ) ); + if ( ( int )( mlt_profile_fps( profile ) * 1000 ) == fps ) { if ( this->frames_in_file > 0 ) { -- 1.7.4.4