mlt_properties_set_position( properties, "length", frames - 1 );
}
- // Check if we're seekable
- mlt_properties_set_int( properties, "seekable", av_seek_frame( context, -1, 0 ) == 0 );
-
// Find default audio and video streams
find_default_streams( context, &audio_index, &video_index );
+ // Check if we're seekable (something funny about mpeg here :-/)
+ if ( strstr( file, ".mpg" ) == NULL && strstr( file, ".mpeg" ) == NULL )
+ mlt_properties_set_int( properties, "seekable", av_seek_frame( context, -1, context->start_time ) >= 0 );
+ else
+ mlt_properties_set_int( properties, "seekable", 1 );
+
// Store selected audio and video indexes on properties
mlt_properties_set_int( properties, "audio_index", audio_index );
mlt_properties_set_int( properties, "video_index", video_index );
else
{
// Set to the real timecode
- av_seek_frame( context, -1, real_timecode * 1000000.0 );
+ av_seek_frame( context, -1, context->start_time + real_timecode * 1000000.0 );
// Remove the cached info relating to the previous position
mlt_properties_set_double( properties, "current_time", real_timecode );
else
{
// Set to the real timecode
- if ( !seekable || av_seek_frame( context, -1, real_timecode * 1000000.0 ) != 0 )
+ if ( !seekable || av_seek_frame( context, -1, context->start_time + real_timecode * 1000000.0 ) != 0 )
paused = 1;
// Clear the usage in the audio buffer
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 );