#include <stdlib.h>
#include <string.h>
#include <signal.h>
+
+/* Needed for backtrace on linux */
+#ifdef linux
#include <execinfo.h>
+#endif
/* Valerie header files */
#include <valerie/valerie_util.h>
{"INSERT", miracle_insert, 1, ATYPE_STRING, "Insert a clip at the given clip index."},
{"REMOVE", miracle_remove, 1, ATYPE_NONE, "Remove a clip at the given clip index."},
{"CLEAN", miracle_clean, 1, ATYPE_NONE, "Clean a unit by removing all but the currently playing clip."},
+ {"CLEAR", miracle_clear, 1, ATYPE_NONE, "Clear a unit by removing all clips."},
{"MOVE", miracle_move, 1, ATYPE_INT, "Move a clip to another clip index."},
{"APND", miracle_append, 1, ATYPE_STRING, "Append a clip specified in absolute filename argument."},
{"PLAY", miracle_play, 1, ATYPE_NONE, "Play a loaded clip at speed -2000 to 2000 where 1000 = normal forward speed."},
static void sigsegv_handler()
{
+#ifdef linux
void *array[ 10 ];
size_t size;
char **strings;
free( strings );
miracle_log( LOG_CRIT, "\nDone dumping - exiting.\n" );
+#else
+ miracle_log( LOG_CRIT, "\a\nMiracle experienced a segmentation fault.\n" );
+#endif
exit( EXIT_FAILURE );
}
static void miracle_local_close( miracle_local local )
{
miracle_delete_all_units();
+#ifdef linux
pthread_kill_other_threads_np();
miracle_log( LOG_DEBUG, "Clean shutdown." );
free( local );
- //mlt_factory_close( );
+ mlt_factory_close( );
+#endif
}