diff --git a/.gitignore b/.gitignore index 682a23c1..7e7b921f 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ checkasm .digress_x264 dataDec.txt log.dec + +obecli diff --git a/configure b/configure index 17d10ad0..fe9b04e8 100755 --- a/configure +++ b/configure @@ -82,6 +82,7 @@ cc_check() { cat conftest.log >> config.log log_msg "--------------------------------------------------" fi + rm conftest.c conftest.o conftest 2>/dev/null return $res } @@ -103,6 +104,7 @@ cpp_check() { cat conftest.log >> config.log log_msg "--------------------------------------------------" fi + rm conftest.c conftest.o conftest 2>/dev/null return $res } @@ -137,6 +139,7 @@ cxx_check() { cat conftest.log >> config.log log_msg "--------------------------------------------------" fi + rm conftest.c conftest.o conftest 2>/dev/null return $res } @@ -159,6 +162,7 @@ as_check() { cat conftest.asm >> config.log log_msg "--------------------------------------------------" fi + rm conftest.asm >/dev/null return $res } @@ -633,10 +637,16 @@ fi if [ "$readline" = "auto" ] ; then readline="no" readlineflags="-lreadline" - if cc_check "readline/readline.h" $readlineflags "rl_initialize();" ; then + if cc_check "readline/readline.h" "$readlineflags" "rl_initialize();" ; then readline="yes" define HAVE_READLINE - LDFLAGS="$LDFLAGS $readlineflags" + LDFLAGSCLI="$readlineflags" + fi + readlineflags="-lncurses -lreadline" + if cc_check "readline/readline.h" "$readlineflags" "rl_initialize();" ; then + readline="yes" + define HAVE_READLINE + LDFLAGSCLI="$readlineflags" fi fi @@ -661,14 +671,9 @@ fi if [ "$decklink" = "auto" ] ; then decklink="no" - log_check "for DeckLink API binary $prefix/lib/libDeckLinkAPI.so" - if [ -f "$prefix/lib/libDeckLinkAPI.so" ] ; then - log_ok - if cxx_check ; then - decklink="yes" - fi - else - log_fail + decklinkflags="-lDeckLinkAPI" + if cc_check "" "$decklinkflags" "" ; then + decklink="yes" fi fi diff --git a/input/sdi/decklink/decklink.cpp b/input/sdi/decklink/decklink.cpp index cd4ba5c6..96fd0fb3 100644 --- a/input/sdi/decklink/decklink.cpp +++ b/input/sdi/decklink/decklink.cpp @@ -833,8 +833,6 @@ static void *probe_stream( void *ptr ) if( open_card( decklink_opts ) < 0 ) goto finish; - sleep( 1 ); - close_card( decklink_opts ); /* TODO: probe for SMPTE 337M */ diff --git a/obe.c b/obe.c index d60e4c54..50b6c91a 100644 --- a/obe.c +++ b/obe.c @@ -993,11 +993,16 @@ void obe_close( obe_t *h ) { void *ret_ptr; + fprintf( stderr, "closing obe \n" ); + /* Cancel input thread */ for( int i = 0; i < h->num_devices; i++ ) { - pthread_cancel( h->devices[i]->device_thread ); - pthread_join( h->devices[i]->device_thread, &ret_ptr ); + if ( h->devices[i]->device_thread ) + { + pthread_cancel( h->devices[i]->device_thread ); + pthread_join( h->devices[i]->device_thread, &ret_ptr ); + } } fprintf( stderr, "input cancelled \n" ); @@ -1028,11 +1033,14 @@ void obe_close( obe_t *h ) /* Cancel mux thread */ - pthread_mutex_lock( &h->mux_mutex ); - h->cancel_mux_thread = 1; - pthread_cond_signal( &h->mux_cv ); - pthread_mutex_unlock( &h->mux_mutex ); - pthread_join( h->mux_thread, &ret_ptr ); + if ( h->mux_thread ) + { + pthread_mutex_lock( &h->mux_mutex ); + h->cancel_mux_thread = 1; + pthread_cond_signal( &h->mux_cv ); + pthread_mutex_unlock( &h->mux_mutex ); + pthread_join( h->mux_thread, &ret_ptr ); + } fprintf( stderr, "mux cancelled \n" ); diff --git a/obecli.c b/obecli.c index 40bf5b0d..8b72535c 100644 --- a/obecli.c +++ b/obecli.c @@ -914,7 +914,8 @@ int main( int argc, char **argv ) if( line_read && *line_read ) { - if( !strcasecmp( line_read, "exit" ) ) + if( !strcasecmp( line_read, "exit" ) || + !strcasecmp( line_read, "quit" ) ) { free( line_read ); break;