Read subtitles from media files, fix bug in text_buffer

This commit is contained in:
2021-03-26 19:48:15 -04:00
parent b1f001d8f1
commit 097580eb40
2 changed files with 7 additions and 2 deletions

View File

@@ -357,8 +357,13 @@ void parse_media_format_ctx(scan_media_ctx_t *ctx, AVFormatContext *pFormatCtx,
}
}
if (subtitle_stream != -1) {
if (subtitle_stream != -1 && ctx->read_subtitles) {
read_subtitles(ctx, pFormatCtx, subtitle_stream, doc);
// Reset stream
if (video_stream != -1) {
av_seek_frame(pFormatCtx, video_stream, 0, 0);
}
}
if (video_stream != -1 && ctx->tn_size > 0) {