Read subtitles from media files, fix bug in text_buffer

This commit is contained in:
2021-03-26 19:48:16 -04:00
parent bc884e137c
commit 50771bd1dc
4 changed files with 7 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ typedef struct scan_args {
const char* treemap_threshold_str;
double treemap_threshold;
int max_memory_buffer;
int read_subtitles;
} scan_args_t;
scan_args_t *scan_args_create();

View File

@@ -132,6 +132,7 @@ void initialize_scan_context(scan_args_t *args) {
ScanCtx.media_ctx.logf = _logf;
ScanCtx.media_ctx.store = _store;
ScanCtx.media_ctx.max_media_buffer = (long) args->max_memory_buffer * 1024 * 1024;
ScanCtx.media_ctx.read_subtitles = args->read_subtitles;
init_media();
// OOXML
@@ -448,6 +449,7 @@ int main(int argc, const char *argv[]) {
OPT_INTEGER(0, "mem-buffer", &scan_args->max_memory_buffer,
"Maximum memory buffer size per thread in MB for files inside archives "
"(see USAGE.md). DEFAULT: 2000"),
OPT_BOOLEAN(0, "read-subtitles", &scan_args->read_subtitles, "Read subtitles from media files."),
OPT_GROUP("Index options"),
OPT_INTEGER('t', "threads", &common_threads, "Number of threads. DEFAULT=1"),