mirror of
https://github.com/simon987/sist2.git
synced 2025-04-24 12:45:56 +00:00
Compare commits
3 Commits
329afcbe4f
...
2882741926
Author | SHA1 | Date | |
---|---|---|---|
2882741926 | |||
edba9b7917 | |||
e89964d592 |
10
third-party/libscan/CMakeLists.txt
vendored
10
third-party/libscan/CMakeLists.txt
vendored
@ -11,11 +11,6 @@ if (SIST_DEBUG)
|
||||
antiword
|
||||
DEBUG
|
||||
)
|
||||
else()
|
||||
add_compile_definitions(
|
||||
antiword
|
||||
NDEBUG
|
||||
)
|
||||
target_compile_options(
|
||||
antiword
|
||||
PRIVATE
|
||||
@ -25,6 +20,11 @@ else()
|
||||
-fsanitize=address
|
||||
-fno-inline
|
||||
)
|
||||
else()
|
||||
add_compile_definitions(
|
||||
antiword
|
||||
NDEBUG
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(
|
||||
|
8
third-party/libscan/libscan/media/media.c
vendored
8
third-party/libscan/libscan/media/media.c
vendored
@ -251,7 +251,7 @@ void append_tag_meta_if_not_exists(scan_media_ctx_t *ctx, document_t *doc, AVDic
|
||||
for (; *ptr; ++ptr) *ptr = (char) tolower(*ptr);
|
||||
|
||||
__always_inline
|
||||
static void append_audio_meta(AVFormatContext *pFormatCtx, document_t *doc) {
|
||||
static void append_audio_meta(scan_media_ctx_t *ctx, AVFormatContext *pFormatCtx, document_t *doc) {
|
||||
|
||||
AVDictionaryEntry *tag = NULL;
|
||||
while ((tag = av_dict_get(pFormatCtx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
||||
@ -269,7 +269,7 @@ static void append_audio_meta(AVFormatContext *pFormatCtx, document_t *doc) {
|
||||
} else if (strcmp(key, "album") == 0) {
|
||||
APPEND_TAG_META(MetaAlbum)
|
||||
} else if (strcmp(key, "comment") == 0) {
|
||||
APPEND_TAG_META(MetaContent)
|
||||
append_tag_meta_if_not_exists(ctx, doc, tag, MetaContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -437,7 +437,7 @@ int decode_frame_and_save_thumbnail(scan_media_ctx_t *ctx, AVFormatContext *pFor
|
||||
return SAVE_THUMBNAIL_FAILED;
|
||||
}
|
||||
|
||||
if (ctx->tesseract_lang != NULL && IS_VIDEO(pFormatCtx)) {
|
||||
if (ctx->tesseract_lang != NULL && IS_VIDEO(pFormatCtx) && thumbnail_index == 0) {
|
||||
ocr_image(ctx, doc, decoder, frame_and_packet->frame);
|
||||
}
|
||||
|
||||
@ -558,7 +558,7 @@ void parse_media_format_ctx(scan_media_ctx_t *ctx, AVFormatContext *pFormatCtx,
|
||||
}
|
||||
|
||||
if (audio_stream != -1) {
|
||||
append_audio_meta(pFormatCtx, doc);
|
||||
append_audio_meta(ctx, pFormatCtx, doc);
|
||||
}
|
||||
|
||||
if (video_stream != -1 && ctx->tn_count > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user