move binary modules to libdir - affects MLT_REPOSITORY
[melted] / src / modules / vorbis / producer_vorbis.c
index 0094822..6016652 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// Local header files
-#include "producer_vorbis.h"
-
 // MLT Header files
+#include <framework/mlt_producer.h>
 #include <framework/mlt_frame.h>
 
 // vorbis Header files
@@ -31,6 +29,7 @@
 // System header files
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 
 // Forward references.
 static int producer_open( mlt_producer this, char *file );
@@ -68,7 +67,7 @@ static sw_metadata *vorbis_metadata_from_str (char * str)
 /** Constructor for libvorbis.
 */
 
-mlt_producer producer_vorbis_init( char *file )
+mlt_producer producer_vorbis_init( mlt_profile profile, mlt_service_type type, const char *id, char *file )
 {
        mlt_producer this = NULL;
 
@@ -163,7 +162,7 @@ static int producer_open( mlt_producer this, char *file )
                        double length = ov_time_total( ov, -1 );
 
                                // We will treat everything with the producer fps
-                               double fps = mlt_properties_get_double( properties, "fps" );
+                               double fps = mlt_producer_get_fps( this );
 
                                // Set out and length of file
                                mlt_properties_set_position( properties, "out", ( length * fps ) - 1 );
@@ -193,14 +192,7 @@ static int producer_open( mlt_producer this, char *file )
 
 static double producer_time_of_frame( mlt_producer this, mlt_position position )
 {
-       // Get the properties
-       mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
-
-       // Obtain the fps
-       double fps = mlt_properties_get_double( properties, "fps" );
-
-       // Do the calc
-       return ( double )position / fps;
+       return ( double )position / mlt_producer_get_fps( this );
 }
 
 /** Get the audio from a frame.
@@ -227,7 +219,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
        mlt_position expected = mlt_properties_get_position( properties, "audio_expected" );
 
        // Get the fps for this producer
-       double fps = mlt_properties_get_double( properties, "fps" );
+       double fps = mlt_producer_get_fps( this );
 
        // Get the vorbis info
        vorbis_info *vi = ov_info( ov, -1 );
@@ -348,7 +340,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
 static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
 {
        // Create an empty frame
-       *frame = mlt_frame_init( );
+       *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( this ) );
 
        // Update timecode on the frame we're creating
        mlt_frame_set_position( *frame, mlt_producer_position( this ) );