obscurer filter, consistency mods and bug fixes
[melted] / src / modules / avformat / producer_avformat.c
index 943b847..d5e6c7e 100644 (file)
@@ -92,7 +92,7 @@ mlt_producer producer_avformat_init( char *file )
 /** Find the default streams.
 */
 
-void find_default_streams( AVFormatContext *context, int *audio_index, int *video_index )
+static void find_default_streams( AVFormatContext *context, int *audio_index, int *video_index )
 {
        int i;
 
@@ -122,7 +122,7 @@ void find_default_streams( AVFormatContext *context, int *audio_index, int *vide
 /** Producer file destructor.
 */
 
-void producer_file_close( void *context )
+static void producer_file_close( void *context )
 {
        if ( context != NULL )
        {
@@ -140,7 +140,7 @@ void producer_file_close( void *context )
 /** Producer file destructor.
 */
 
-void producer_codec_close( void *codec )
+static void producer_codec_close( void *codec )
 {
        if ( codec != NULL )
        {
@@ -204,8 +204,8 @@ static int producer_open( mlt_producer this, char *file )
                        {
                                // This isn't going to be accurate for all formats
                                mlt_position frames = ( mlt_position )( ( ( double )context->duration / ( double )AV_TIME_BASE ) * fps );
-                               mlt_properties_set_position( properties, "out", frames - 1 );
-                               mlt_properties_set_position( properties, "length", frames );
+                               mlt_properties_set_position( properties, "out", frames - 2 );
+                               mlt_properties_set_position( properties, "length", frames - 1 );
                        }
 
                        // Find default audio and video streams
@@ -699,6 +699,7 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form
                }
 
                // Now handle the audio if we have enough
+
                if ( audio_used >= *samples )
                {
                        *buffer = malloc( *samples * *channels * sizeof( int16_t ) );