diff --git a/.github/workflows/meson-build-apps.yml b/.github/workflows/meson-build-apps.yml index 2479ec0..c9f2a05 100644 --- a/.github/workflows/meson-build-apps.yml +++ b/.github/workflows/meson-build-apps.yml @@ -56,12 +56,10 @@ jobs: $GITHUB_WORKSPACE/local_installs/bin/validator -c h265 svf_apps/test-files/signed_test_h265.mp4 $GITHUB_WORKSPACE/local_installs/bin/validator -c h264 svf_apps/test-files/signed_vendor_axis.h264 cat validation_results.txt - - name: Copy test files for signing - run: cp svf_apps/test-files/test_h26*.mp4 . - name: Run signer on test-files run: | export GST_PLUGIN_PATH=$GITHUB_WORKSPACE/local_installs - $GITHUB_WORKSPACE/local_installs/bin/signer -c h264 test_h264.mp4 - $GITHUB_WORKSPACE/local_installs/bin/validator -c h264 signed_test_h264.mp4 - $GITHUB_WORKSPACE/local_installs/bin/signer -c h265 test_h265.mp4 - $GITHUB_WORKSPACE/local_installs/bin/validator -c h265 signed_test_h265.mp4 + $GITHUB_WORKSPACE/local_installs/bin/signer -c h264 svf_apps/test-files/test_h264.mp4 + $GITHUB_WORKSPACE/local_installs/bin/validator -c h264 svf_apps/test-files/signed_test_h264.mp4 + $GITHUB_WORKSPACE/local_installs/bin/signer -c h265 svf_apps/test-files/test_h265.mp4 + $GITHUB_WORKSPACE/local_installs/bin/validator -c h265 svf_apps/test-files/signed_test_h265.mp4 diff --git a/apps/signer/main.c b/apps/signer/main.c index aedc046..e596180 100644 --- a/apps/signer/main.c +++ b/apps/signer/main.c @@ -152,7 +152,23 @@ main(gint argc, gchar *argv[]) // Parse filename. if (arg < argc) { filename = argv[arg]; - outfilename = g_strdup_printf("signed_%s", filename); + // Extract filename from path. Try both Windows and Linux style. + gchar *pathname = g_strdup(filename); + gchar *end_path_name_linux = strrchr(pathname, '/'); + gchar *end_path_name_win = strrchr(pathname, '\\'); + if (end_path_name_linux && end_path_name_win) { + g_error("Filename %s has invalid characters", filename); + } + if (end_path_name_linux) { + *end_path_name_linux = '\0'; + outfilename = g_strdup_printf("%s/signed_%s", pathname, end_path_name_linux + 1); + } else if (end_path_name_win) { + *end_path_name_win = '\0'; + outfilename = g_strdup_printf("%s\\signed_%s", pathname, end_path_name_win + 1); + } else { + outfilename = g_strdup_printf("signed_%s", filename); + } + g_free(pathname); g_message( "\nThe result of signing '%s' will be written to '%s'.\n" "Private and public key stored at '%s'", diff --git a/test-files/signed_test_h264.mp4 b/test-files/signed_test_h264.mp4 index 8a577ca..781403c 100644 Binary files a/test-files/signed_test_h264.mp4 and b/test-files/signed_test_h264.mp4 differ