]> git.sesse.net Git - mlt/commitdiff
Fix crash at end of some files with audio_index=all.
authorDan Dennedy <dan@dennedy.org>
Thu, 17 Dec 2009 08:56:52 +0000 (00:56 -0800)
committerDan Dennedy <dan@dennedy.org>
Thu, 17 Dec 2009 08:56:52 +0000 (00:56 -0800)
src/modules/avformat/producer_avformat.c

index 2c38fc706a5d6878725bd035dcae815775d0e72e..1fc2d4b7743208b8295310abad1212898cf27e43 100644 (file)
@@ -1708,7 +1708,7 @@ static int producer_get_audio( mlt_frame frame, void **buffer, mlt_audio_format
                                }
                        }
                        for ( index = 0; index < index_max; index++ )
-                       if ( this->audio_codec[ index ] )
+                       if ( this->audio_codec[ index ] && this->audio_used[ index ] >= *samples )
                        {
                                int current_channels = this->audio_codec[ index ]->channels;
                                int16_t *src = this->audio_buffer[ index ] + *samples * current_channels;
@@ -1935,7 +1935,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 
 static void producer_avformat_close( producer_avformat this )
 {
-       mlt_log_debug( MLT_PRODUCER_SERVICE(this->parent), "producer_avformat_close\n" );
+       mlt_log_debug( NULL, "producer_avformat_close\n" );
        // Close the file
        av_free( this->av_frame );
        avformat_lock();