Skip to content

Commit e35eb45

Browse files
committed
Fix compilation with MSVC
error C2131: expression did not evaluate to a constant
1 parent 59f17bf commit e35eb45

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -673,22 +673,24 @@ void Transcoder::fillProcessStat(ProcessStat& processStat)
673673
// uint8_t picture_type = coded_frame[4];
674674
uint8_t error_count = coded_frame[5];
675675

676-
uint64_t errors[error_count];
676+
std::vector<uint64_t> errors;
677677
for (int i = 0; i < error_count; ++i)
678678
{
679679
int index = 6 + i;
680-
errors[i] = (uint64_t) coded_frame[index + 7] << 56 |
681-
(uint64_t) coded_frame[index + 6] << 48 |
682-
(uint64_t) coded_frame[index + 5] << 40 |
683-
(uint64_t) coded_frame[index + 4] << 32 |
684-
(uint64_t) coded_frame[index + 3] << 24 |
685-
(uint64_t) coded_frame[2] << 16 |
686-
(uint64_t) coded_frame[1] << 8 |
687-
(uint64_t) coded_frame[0];
680+
errors.push_back(
681+
(uint64_t) coded_frame[index + 7] << 56 |
682+
(uint64_t) coded_frame[index + 6] << 48 |
683+
(uint64_t) coded_frame[index + 5] << 40 |
684+
(uint64_t) coded_frame[index + 4] << 32 |
685+
(uint64_t) coded_frame[index + 3] << 24 |
686+
(uint64_t) coded_frame[2] << 16 |
687+
(uint64_t) coded_frame[1] << 8 |
688+
(uint64_t) coded_frame[0]
689+
);
688690
}
689691

690692
videoStat.setQuality(quality);
691-
videoStat.setPSNR((double) errors[0] /
693+
videoStat.setPSNR((double) errors.at(0) /
692694
(encoderContext.width * encoderContext.height * 255.0 * 255.0));
693695
}
694696
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy