Skip to content

Commit 4c2c71d

Browse files
committed
Update to GCC 14.1.0
1 parent ab39526 commit 4c2c71d

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

src/m3u8download.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ static int m3u8download_pollqeue(
328328
}
329329
}
330330

331-
(*options->progress_callback)(qeue->offset, current);
331+
if (options->progress_callback != NULL) {
332+
(*options->progress_callback)(qeue->offset, current);
333+
}
332334

333335
while (running) {
334336
CURLMcode mc = curl_multi_perform(curl_multi, &running);
@@ -387,7 +389,10 @@ static int m3u8download_pollqeue(
387389
curl_multi_add_handle(curl_multi, msg->easy_handle);
388390
} else {
389391
current++;
390-
(*options->progress_callback)(qeue->offset, current);
392+
393+
if (options->progress_callback != NULL) {
394+
(*options->progress_callback)(qeue->offset, current);
395+
}
391396
}
392397
}
393398

src/main.c

+10
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ int main(int argc, argv_t* argv[]) {
161161
int insecure = 0;
162162
int debug = 0;
163163
int disable_autoselection = 0;
164+
int disable_progress = 0;
164165

165166
int select_all_medias = 0;
166167
int exists = 0;
@@ -610,6 +611,15 @@ int main(int argc, argv_t* argv[]) {
610611
}
611612

612613
disable_autoselection = 1;
614+
} else if (strcmp(argument->key, "disable-progress-meter") == 0) {
615+
if (disable_progress) {
616+
err = M3U8ERR_CLI_DUPLICATE_ARGUMENT;
617+
goto end;
618+
}
619+
620+
download_options.progress_callback = NULL;
621+
622+
disable_progress = 1;
613623
} else {
614624
err = M3U8ERR_CLI_ARGUMENT_INVALID;
615625
goto end;

src/program_help.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file is auto-generated. Use the ../tools/program_help.h.py tool to regenera
66
#define PROGRAM_HELP_H
77

88
#define PROGRAM_HELP \
9-
"usage: kai [-h] [-v] -u URL [-k] [-A USER_AGENT] [-x URI] [--doh-url URL] [-e URL] [-r COUNT] [--debug] [-S] [--select-media MEDIA] [--select-stream VARIANT_STREAM] [--disable-autoselection] [-c CONCURRENCY] -o FILENAME\n" \
9+
"usage: kai [-h] [-v] -u URL [-k] [-A USER_AGENT] [-x URI] [--doh-url URL] [-e URL] [-r COUNT] [--debug] [-S] [--select-media MEDIA] [--select-stream VARIANT_STREAM] [--disable-autoselection] [--disable-progress-meter] [-c CONCURRENCY] -o FILENAME\n" \
1010
"\n" \
1111
"A command-line utility to download contents from M3U8 playlists.\n" \
1212
"\n" \
@@ -30,6 +30,8 @@ This file is auto-generated. Use the ../tools/program_help.h.py tool to regenera
3030
" Select which variant stream to download. Defaults to the variant stream with the highest bandwidth (bits per second).\n" \
3131
" --disable-autoselection\n" \
3232
" Avoid autoselection of streams based on predefined preferences set by the master playlist.\n" \
33+
" --disable-progress-meter\n" \
34+
" Disable showing download progress meter.\n" \
3335
" -c CONCURRENCY, --concurrency CONCURRENCY\n" \
3436
" Specify how many media segments should be downloaded simultaneously. Defaults to 1.\n" \
3537
" -o FILENAME, --output FILENAME\n" \

tools/program_help.h.py

+7
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@
116116
help = "Avoid autoselection of streams based on predefined preferences set by the master playlist."
117117
)
118118

119+
parser.add_argument(
120+
"--disable-progress-meter",
121+
required = False,
122+
action = "store_true",
123+
help = "Disable showing download progress meter."
124+
)
125+
119126
parser.add_argument(
120127
"-c",
121128
"--concurrency",

0 commit comments

Comments
 (0)