Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit faa20650 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Matroskaextractor: improve findThumbnails() time." into main

parents 658922e9 239dab84
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2312,6 +2312,8 @@ void MatroskaExtractor::findThumbnails() {
        int64_t thumbnailTimeUs = 0;
        size_t maxBlockSize = 0;
        while (!iter.eos() && j < 20) {
            int64_t blockTimeUs = iter.blockTimeUs();

            if (iter.block()->IsKey()) {
                ++j;

@@ -2322,8 +2324,12 @@ void MatroskaExtractor::findThumbnails() {

                if (blockSize > maxBlockSize) {
                    maxBlockSize = blockSize;
                    thumbnailTimeUs = iter.blockTimeUs();
                    thumbnailTimeUs = blockTimeUs;
                }
            }
            // Exit after 20s if we've already found at least one key frame.
            if (blockTimeUs > 20000000 && maxBlockSize > 0) {
                break;
            }
            iter.advance();
        }