From 27bd2c44278ccf181b11ba961649a3e9b3ae03af Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 11 Oct 2015 18:37:14 +0100 Subject: Better progress indication when finding subs (#711). --- ChangeLog | 3 +++ src/lib/ffmpeg_examiner.cc | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7777862ce..9d957bf15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-10-11 Carl Hetherington + * Provide progress indication when finding + subtitles (#711). + * Updated ru_RU translation from Igor Voytovich. * Updated pl_PL translation from Marek Skrzelowski. diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 40fe0d28e..4fd1b6fe8 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -76,13 +76,14 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptrduration == AV_NOPTS_VALUE; if (!_need_video_length) { _video_length = (double (_format_context->duration) / AV_TIME_BASE) * video_frame_rate().get (); - } else if (job) { - job->sub (_("Finding length")); - job->set_progress_unknown (); } if (job) { - job->sub (_("Finding subtitles")); + if (_need_video_length) { + job->sub (_("Finding length and subtitles")); + } else { + job->sub (_("Finding subtitles")); + } } /* Run through until we find: @@ -95,6 +96,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptr c, shared_ptrset_progress_unknown (); + if (len > 0) { + job->set_progress (float (_format_context->pb->pos) / len); + } else { + job->set_progress_unknown (); + } } AVCodecContext* context = _format_context->streams[_packet.stream_index]->codec; -- cgit v1.2.3