From 3f0bdcb0f1d61178938be240d082fce13198dd6e Mon Sep 17 00:00:00 2001 From: sslivins Date: Sat, 9 Jul 2016 18:26:08 -0700 Subject: [PATCH] moved the starting of ftl-express until everything has been authenticated with the server --- build_scripts/build_tachyon_windows_vs.bat | 2 +- build_scripts/tachyon_windows_installer.nsi | 2 +- plugins/obs-ffmpeg/obs-ffmpeg-output.c | 81 +++++++++++---------- 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/build_scripts/build_tachyon_windows_vs.bat b/build_scripts/build_tachyon_windows_vs.bat index c2152426..dcf0ab9c 100644 --- a/build_scripts/build_tachyon_windows_vs.bat +++ b/build_scripts/build_tachyon_windows_vs.bat @@ -1,7 +1,7 @@ REM check for cef binary REM check for dependencies (ffmpeg, etc) SET build_config=Release -SET obs_version=1.2.6 +SET obs_version=1.2.8 SET cef_binary_dir=C:\beam\cef_binary SET cef_release_dir=C:\beam\obs-browser-1.22 SET coredeps=C:\beam\tachyon_deps diff --git a/build_scripts/tachyon_windows_installer.nsi b/build_scripts/tachyon_windows_installer.nsi index 5a33fab7..3f496782 100644 --- a/build_scripts/tachyon_windows_installer.nsi +++ b/build_scripts/tachyon_windows_installer.nsi @@ -3,7 +3,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "Tachyon" !define DEFAULT_INST_DIR "$PROGRAMFILES\${PRODUCT_NAME}" -!define PRODUCT_VERSION "1.2.6" +!define PRODUCT_VERSION "1.2.8" !define PRODUCT_PUBLISHER "Beam Interactive" !define PRODUCT_WEB_SITE "http://beam.pro" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\tachyon64.exe" diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-output.c b/plugins/obs-ffmpeg/obs-ffmpeg-output.c index b808b368..8f3c0fb9 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-output.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-output.c @@ -1190,47 +1190,8 @@ static int try_connect(struct ffmpeg_output *output) return OBS_OUTPUT_ERROR; } - /* Glue together the ingest URL */ - int size = 0; - -#ifdef _WIN32 - swprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg)/sizeof(wchar_t), L"-rtpingestaddr=%hs:8082", config.ingest_location); - blog(LOG_WARNING, "FTL ingest args are: %S\n", ftl_ingest_arg); - ZeroMemory( &output->ShExecInfo, sizeof(output->ShExecInfo) ); - output->ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); - output->ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_WAITFORINPUTIDLE - output->ShExecInfo.hwnd = NULL; - output->ShExecInfo.lpVerb = L"open"; - output->ShExecInfo.lpFile = L"ftl-express.exe"; - output->ShExecInfo.lpParameters = ftl_ingest_arg; - output->ShExecInfo.lpDirectory = NULL; - output->ShExecInfo.nShow = /*SW_SHOW;*/SW_HIDE; - output->ShExecInfo.hInstApp = NULL; - ShellExecuteEx(&output->ShExecInfo); - SetPriorityClass(output->ShExecInfo.hProcess, HIGH_PRIORITY_CLASS); -#elif __APPLE__ - -#else - snprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg), "-rtpingestaddr=%s:8082", config.ingest_location); - blog(LOG_WARNING, "FTL ingest args are: %s\n", ftl_ingest_arg); - /* print error message if fork() fails */ - blog(LOG_WARNING, "Forking Process\n"); - - if((output->ftl_express_pid = fork()) < 0 ) - { - blog(LOG_ERROR, "call to fork failed\n"); - return OBS_OUTPUT_ERROR; - } - - if(output->ftl_express_pid == 0) - { - execlp("ftl-express", "ftl-express", ftl_ingest_arg, NULL); - - blog(LOG_ERROR, "failed to start ftl-express\n"); - exit(1); - } -#endif + int size = 0; //size = snprintf(config.url, 2048, "rtp://%s:8082?pkt_size=1350", config.ingest_location); size = snprintf(config.url, 2048, "rtp://%s:8082?pkt_size=1350", "127.0.0.1"); if (size == 2048) { @@ -1333,6 +1294,46 @@ static int try_connect(struct ffmpeg_output *output) return OBS_OUTPUT_ERROR; } + /* Glue together the ingest URL */ + +#ifdef _WIN32 + swprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg)/sizeof(wchar_t), L"-rtpingestaddr=%hs:8082", config.ingest_location); + blog(LOG_WARNING, "FTL ingest args are: %S\n", ftl_ingest_arg); + ZeroMemory( &output->ShExecInfo, sizeof(output->ShExecInfo) ); + output->ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); + output->ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_WAITFORINPUTIDLE + output->ShExecInfo.hwnd = NULL; + output->ShExecInfo.lpVerb = L"open"; + output->ShExecInfo.lpFile = L"ftl-express.exe"; + output->ShExecInfo.lpParameters = ftl_ingest_arg; + output->ShExecInfo.lpDirectory = NULL; + output->ShExecInfo.nShow = /*SW_SHOW;*/SW_HIDE; + output->ShExecInfo.hInstApp = NULL; + ShellExecuteEx(&output->ShExecInfo); + SetPriorityClass(output->ShExecInfo.hProcess, HIGH_PRIORITY_CLASS); +#elif __APPLE__ + +#else + snprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg), "-rtpingestaddr=%s:8082", config.ingest_location); + blog(LOG_WARNING, "FTL ingest args are: %s\n", ftl_ingest_arg); + /* print error message if fork() fails */ + blog(LOG_WARNING, "Forking Process\n"); + + if((output->ftl_express_pid = fork()) < 0 ) + { + blog(LOG_ERROR, "call to fork failed\n"); + return OBS_OUTPUT_ERROR; + } + + if(output->ftl_express_pid == 0) + { + execlp("ftl-express", "ftl-express", ftl_ingest_arg, NULL); + + blog(LOG_ERROR, "failed to start ftl-express\n"); + exit(1); + } +#endif + obs_output_set_video_conversion(output->output, NULL); obs_output_set_audio_conversion(output->output, &aci); obs_output_begin_data_capture(output->output, 0);