iheight = iheight - ( iheight % 2 );
oheight = oheight - ( oheight % 2 );
+ // Optimisation point
+ if ( iwidth == owidth && iheight == oheight )
+ memcpy( output, input, iheight * istride );
+
// Coordinates (0,0 is middle of output)
int y;
else if ( current == dest )
current = src;
+ src_entry = this->list[ src ];
if ( src > dest )
{
- int t = dest;
- dest = src;
- src = t;
+ for ( i = src; i > dest; i -- )
+ this->list[ i ] = this->list[ i - 1 ];
+ }
+ else
+ {
+ for ( i = src; i < dest; i ++ )
+ this->list[ i ] = this->list[ i + 1 ];
}
-
- src_entry = this->list[ src ];
-
- for ( i = src + 1; i <= dest; i ++ )
- this->list[ i - 1 ] = this->list[ i ];
-
this->list[ dest ] = src_entry;
mlt_playlist_get_clip_info( this, ¤t_info, current );
#include <stdlib.h>
#include <string.h>
#include <signal.h>
+#include <execinfo.h>
+#include <stdio.h>
/* Valerie header files */
#include <valerie/valerie_util.h>
}
}
+static void sigsegv_handler()
+{
+ void *array[ 10 ];
+ size_t size;
+ char **strings;
+ size_t i;
+
+ fprintf( stderr, "\a\nMiracle experienced a segmentation fault.\n"
+ "Dumping stack from the offending thread\n\n" );
+ size = backtrace( array, 10 );
+ strings = backtrace_symbols( array, size );
+
+ fprintf( stderr, "Obtained %zd stack frames.\n", size );
+
+ for ( i = 0; i < size; i++ )
+ fprintf( stderr, "%s\n", strings[ i ] );
+
+ free( strings );
+
+ fprintf( stderr, "\nDone dumping - exiting.\n" );
+ exit( EXIT_FAILURE );
+}
+
+
+
/** Local 'connect' function.
*/
signal( SIGPIPE, signal_handler );
signal( SIGALRM, signal_handler );
signal( SIGCHLD, SIG_IGN );
+ signal( SIGSEGV, sigsegv_handler );
return response;
}
void valerie_notifier_put( valerie_notifier this, valerie_status status )
{
+ static unsigned int counter = 0;
pthread_mutex_lock( &this->mutex );
valerie_status_copy( &this->store[ status->unit ], status );
valerie_status_copy( &this->last, status );