/** 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;
/** Producer file destructor.
*/
-void producer_file_close( void *context )
+static void producer_file_close( void *context )
{
if ( context != NULL )
{
/** Producer file destructor.
*/
-void producer_codec_close( void *codec )
+static void producer_codec_close( void *codec )
{
if ( codec != NULL )
{
{
// 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
// Get the video_index
int index = mlt_properties_get_int( properties, "video_index" );
+ // Get the frame properties
+ mlt_properties frame_properties = mlt_frame_properties( frame );
+
// Lock the mutex now
pthread_mutex_lock( &avformat_mutex );
if ( context != NULL && index != -1 )
{
- // Get the frame properties
- mlt_properties frame_properties = mlt_frame_properties( frame );
-
// Get the video stream
AVStream *stream = context->streams[ index ];
mlt_frame_push_get_image( frame, producer_get_image );
mlt_properties_set_data( frame_properties, "avformat_producer", this, 0, NULL, NULL );
}
+ else
+ {
+ mlt_properties_set_int( frame_properties, "test_image", 1 );
+ }
+ }
+ else
+ {
+ mlt_properties_set_int( frame_properties, "test_image", 1 );
}
// Unlock the mutex now
}
// Now handle the audio if we have enough
+
if ( audio_used >= *samples )
{
*buffer = malloc( *samples * *channels * sizeof( int16_t ) );