mlt_properties_set_int( frame_properties, "width", *width );
mlt_properties_set_int( frame_properties, "height", *height );
- // Lock the mutex now
- avformat_lock( );
-
// Construct an AVFrame for YUV422 conversion
if ( output == NULL )
{
if ( got_picture )
{
- if ( pkt.pts != AV_NOPTS_VALUE && pkt.pts != 0 )
+ if ( pkt.pts != AV_NOPTS_VALUE )
current_time = ( double )pkt.pts / 1000000.0;
else
current_time = real_timecode;
// Regardless of speed, we expect to get the next frame (cos we ain't too bright)
mlt_properties_set_position( properties, "video_expected", position + 1 );
- // Unlock the mutex now
- avformat_unlock( );
-
return 0;
}
// Get the frame properties
mlt_properties frame_properties = mlt_frame_properties( frame );
- // Lock the mutex now
- avformat_lock( );
-
if ( context != NULL && index != -1 )
{
// Get the video stream
{
mlt_properties_set_int( frame_properties, "test_image", 1 );
}
-
- // Unlock the mutex now
- avformat_unlock( );
}
/** Get the audio from a frame.
// Flag for paused (silence)
int paused = 0;
- // Lock the mutex now
- avformat_lock( );
-
// Check for resample and create if necessary
if ( resample == NULL && codec_context->channels <= 2 )
{
if ( !paused )
mlt_properties_set_position( properties, "audio_expected", position + 1 );
- // Unlock the mutex now
- avformat_unlock( );
-
return 0;
}
// Get the audio_index
int index = mlt_properties_get_int( properties, "audio_index" );
- // Lock the mutex now
- avformat_lock( );
-
// Deal with audio context
if ( context != NULL && index != -1 )
{
mlt_properties_set_data( frame_properties, "avformat_producer", this, 0, NULL, NULL );
}
}
-
- // Unlock the mutex now
- avformat_unlock( );
}
/** Our get frame implementation.
mlt_frame_set_position( *frame, mlt_producer_position( this ) );
// Set the position of this producer
- mlt_properties_set_position( mlt_frame_properties( *frame ), "avformat_position", mlt_producer_get_in( this ) + mlt_producer_position( this ) );
+ mlt_properties_set_position( mlt_frame_properties( *frame ), "avformat_position", mlt_producer_position( this ) );
// Set up the video
producer_set_up_video( this, *frame );