timestamp -= 2 / av_q2d( self->video_time_base );
if ( timestamp < 0 )
timestamp = 0;
- mlt_log_debug( MLT_PRODUCER_SERVICE(producer), "seeking timestamp %"PRId64" position %d expected %d last_pos %"PRId64"\n",
+ mlt_log_debug( MLT_PRODUCER_SERVICE(producer), "seeking timestamp %"PRId64" position " MLT_POSITION_FMT " expected "MLT_POSITION_FMT" last_pos %"PRId64"\n",
timestamp, position, self->video_expected, self->last_position );
// Seek to the timestamp
pthread_mutex_unlock( &self->packets_mutex );
goto exit_get_image;
}
+ if ( !self->seekable && mlt_properties_get_int( properties, "exit_on_disconnect" ) )
+ {
+ mlt_log_fatal( MLT_PRODUCER_SERVICE(producer), "Exiting with error due to disconnected source.\n" );
+ exit( EXIT_FAILURE );
+ }
}
}
pthread_mutex_unlock( &self->packets_mutex );
}
else if ( ret < 0 )
{
- mlt_log_verbose( MLT_PRODUCER_SERVICE(self->parent), "av_read_frame returned error %d inside get_audio\n", ret );
- if ( !self->seekable && mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( self->parent ), "reconnect" ) )
+ mlt_producer producer = self->parent;
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
+ mlt_log_verbose( MLT_PRODUCER_SERVICE(producer), "av_read_frame returned error %d inside get_audio\n", ret );
+ if ( !self->seekable && mlt_properties_get_int( properties, "reconnect" ) )
{
// Try to reconnect to live sources by closing context and codecs,
// and letting next call to get_frame() reopen.
pthread_mutex_unlock( &self->packets_mutex );
goto exit_get_audio;
}
+ if ( !self->seekable && mlt_properties_get_int( properties, "exit_on_disconnect" ) )
+ {
+ mlt_log_fatal( MLT_PRODUCER_SERVICE(producer), "Exiting with error due to disconnected source.\n" );
+ exit( EXIT_FAILURE );
+ }
}
}
pthread_mutex_unlock( &self->packets_mutex );