From 81070338466846aa7a716695f269fced6b0f4701 Mon Sep 17 00:00:00 2001 From: Pavel Tcherniaev Date: Wed, 13 Dec 2023 10:55:40 -0800 Subject: [PATCH] added help for arguments in case user doesn't give any arguments (#138) [ROCm/rocdecode commit: 5930f15c1a9ed738c74987ccbed08a62fae632a0] --- projects/rocdecode/samples/videoDecode/videodecode.cpp | 2 +- projects/rocdecode/samples/videoDecodeFork/videodecodefork.cpp | 2 +- projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp | 2 +- .../samples/videoDecodeMultiFiles/videodecodemultifiles.cpp | 2 +- projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp | 2 +- projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/rocdecode/samples/videoDecode/videodecode.cpp b/projects/rocdecode/samples/videoDecode/videodecode.cpp index ef327b4e97..b0c61f1cde 100644 --- a/projects/rocdecode/samples/videoDecode/videodecode.cpp +++ b/projects/rocdecode/samples/videoDecode/videodecode.cpp @@ -68,7 +68,7 @@ int main(int argc, char **argv) { Rect *p_crop_rect = nullptr; OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_DEV_INTERNAL; // set to internal // Parse command-line arguments - if(argc < 1) { + if(argc <= 1) { ShowHelpAndExit(); } for (int i = 1; i < argc; i++) { diff --git a/projects/rocdecode/samples/videoDecodeFork/videodecodefork.cpp b/projects/rocdecode/samples/videoDecodeFork/videodecodefork.cpp index 20ab053e23..95c014bb00 100644 --- a/projects/rocdecode/samples/videoDecodeFork/videodecodefork.cpp +++ b/projects/rocdecode/samples/videoDecodeFork/videodecodefork.cpp @@ -73,7 +73,7 @@ int main(int argc, char **argv) { OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_DEV_INTERNAL; // set to internal bool b_force_zero_latency = false; // Parse command-line arguments - if(argc < 1) { + if(argc <= 1) { ShowHelpAndExit(); } for (int i = 1; i < argc; i++) { diff --git a/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp b/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp index 53f8d337ce..4856af4863 100644 --- a/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp +++ b/projects/rocdecode/samples/videoDecodeMem/videodecodemem.cpp @@ -83,7 +83,7 @@ int main(int argc, char **argv) { Rect *p_crop_rect = nullptr; OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_DEV_INTERNAL; // set to internal // Parse command-line arguments - if(argc < 1) { + if(argc <= 1) { ShowHelpAndExit(); } for (int i = 1; i < argc; i++) { diff --git a/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp b/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp index 2fff03c9da..eb5f5ad6fe 100644 --- a/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp +++ b/projects/rocdecode/samples/videoDecodeMultiFiles/videodecodemultifiles.cpp @@ -76,7 +76,7 @@ void ParseCommandLine(std::deque *multi_file_data, int &device_id, boo std::string file_list_path; // Parse command-line arguments - if(argc < 1) { + if(argc <= 1) { ShowHelpAndExit(); } for (int i = 1; i < argc; i++) { diff --git a/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp b/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp index ccd0e08ad4..2d8cacdf4e 100644 --- a/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp +++ b/projects/rocdecode/samples/videoDecodePerf/videodecodeperf.cpp @@ -80,7 +80,7 @@ int main(int argc, char **argv) { OutputSurfaceMemoryType mem_type = OUT_SURFACE_MEM_DEV_INTERNAL; // set to internal bool b_force_zero_latency = false; // Parse command-line arguments - if(argc < 1) { + if(argc <= 1) { ShowHelpAndExit(); } for (int i = 1; i < argc; i++) { diff --git a/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp b/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp index 41a1cef2a5..11655c8760 100644 --- a/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp +++ b/projects/rocdecode/samples/videoDecodeRGB/videodecrgb.cpp @@ -166,7 +166,7 @@ int main(int argc, char **argv) { int rgb_width; // Parse command-line arguments - if(argc < 1) { + if(argc <= 1) { ShowHelpAndExit(); } for (int i = 1; i < argc; i++) {