Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / renderfarmclient.C
index 17b345112a4c49891650d459fbe3fe0a51c541bf..7c50bd5401a177e403ec0728ecb9efc20f01f6a1 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2003-2016 Cinelerra CV contributors
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -77,6 +78,7 @@ RenderFarmClient::RenderFarmClient(int port,
        boot_preferences = new Preferences;
        boot_preferences->load_defaults(boot_defaults);
        MWindow::init_plugins(0, boot_preferences);
        boot_preferences = new Preferences;
        boot_preferences->load_defaults(boot_defaults);
        MWindow::init_plugins(0, boot_preferences);
+       MWindow::init_ladspa_plugins(0, boot_preferences);  
        BC_Signals::set_catch_segv(boot_preferences->trap_sigsegv);
        BC_Signals::set_catch_intr(0);
         if( boot_preferences->trap_sigsegv ) {
        BC_Signals::set_catch_segv(boot_preferences->trap_sigsegv);
        BC_Signals::set_catch_intr(0);
         if( boot_preferences->trap_sigsegv ) {
@@ -122,6 +124,11 @@ void RenderFarmClient::main_loop()
                        perror(_("RenderFarmClient::main_loop: socket"));
                        return;
                }
                        perror(_("RenderFarmClient::main_loop: socket"));
                        return;
                }
+               struct linger lgr;
+               lgr.l_onoff = 0;
+               lgr.l_linger = 0;
+               if( setsockopt(socket_fd, SOL_SOCKET, SO_LINGER, &lgr, sizeof(lgr)) < 0 )
+                       perror("RenderFarmClient::setsockopt:setlinger 0");
 
                if(bind(socket_fd,
                        (struct sockaddr*)&addr,
 
                if(bind(socket_fd,
                        (struct sockaddr*)&addr,
@@ -147,6 +154,11 @@ void RenderFarmClient::main_loop()
                        perror(_("RenderFarmClient::main_loop: socket"));
                        return;
                }
                        perror(_("RenderFarmClient::main_loop: socket"));
                        return;
                }
+               struct linger lgr;
+               lgr.l_onoff = 0;
+               lgr.l_linger = 0;
+               if( setsockopt(socket_fd, SOL_SOCKET, SO_LINGER, &lgr, sizeof(lgr)) < 0 )
+                       perror("RenderFarmClient::setsockopt:setlinger 1");
 
                if(bind(socket_fd,
                        (struct sockaddr*)&addr,
 
                if(bind(socket_fd,
                        (struct sockaddr*)&addr,
@@ -267,7 +279,8 @@ int RenderFarmClientThread::read_socket(char *data, int len)
        int bytes_read = 0;
        int offset = 0;
 //printf("RenderFarmClientThread::read_socket 1\n");
        int bytes_read = 0;
        int offset = 0;
 //printf("RenderFarmClientThread::read_socket 1\n");
-       watchdog->begin_request();
+       if( watchdog )
+               watchdog->begin_request();
        while(len > 0 && bytes_read >= 0)
        {
                bytes_read = read(socket_fd, data + offset, len);
        while(len > 0 && bytes_read >= 0)
        {
                bytes_read = read(socket_fd, data + offset, len);
@@ -282,7 +295,8 @@ int RenderFarmClientThread::read_socket(char *data, int len)
                        break;
                }
        }
                        break;
                }
        }
-       watchdog->end_request();
+       if( watchdog )
+               watchdog->end_request();
 //printf("RenderFarmClientThread::read_socket 10\n");
 
        return offset;
 //printf("RenderFarmClientThread::read_socket 10\n");
 
        return offset;