Skip to content

Commit

Permalink
Merge branch 'feature/vvcdec' of github.com:IENT/YUView into feature/…
Browse files Browse the repository at this point in the history
…vvcdec
  • Loading branch information
ChristianFeldmann committed Feb 25, 2021
2 parents cdf071d + 903e307 commit dfe95b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions YUViewLib/src/decoder/decoderVVDec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ decoderVVDec::decoderVVDec(int signalID, bool cachingDecoder)
// Try to load the decoder library (.dll on Windows, .so on Linux, .dylib on Mac)
QSettings settings;
settings.beginGroup("Decoders");
this->loadDecoderLibrary(settings.value("libvvdecFile", "").toString());
this->loadDecoderLibrary(settings.value("libVVDecFile", "").toString());
settings.endGroup();

if (this->decoderState != DecoderState::Error)
Expand Down Expand Up @@ -378,7 +378,7 @@ void decoderVVDec::copyImgToByteArray(QByteArray &dst)
{
auto bitDepthU = this->lib.libvvdec_get_picture_bit_depth(this->decoder, LIBvvdec_CHROMA_U);
auto bitDepthV = this->lib.libvvdec_get_picture_bit_depth(this->decoder, LIBvvdec_CHROMA_V);
if ((outputTwoByte != bitDepthU > 8) || (outputTwoByte != bitDepthV > 8))
if ((outputTwoByte != (bitDepthU > 8)) || (outputTwoByte != (bitDepthV > 8)))
{
DEBUG_vvdec("decoderVVDec::copyImgToByteArray different bit depth in YUV components. This "
"is not supported.");
Expand Down
15 changes: 6 additions & 9 deletions YUViewLib/src/filesource/FileSourceFFmpegFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,14 @@ std::pair<int64_t, size_t> FileSourceFFmpegFile::getClosestSeekableFrameBefore(i

for (const auto &pic : this->keyFrameList)
{
if (pic.frame >= 0)
if (frameIdx > 0 && pic.frame <= unsigned(frameIdx))
{
if (frameIdx > 0 && pic.frame <= unsigned(frameIdx))
{
// We could seek here
bestSeekDTS = pic.dts;
seekToFrameIdx = pic.frame;
}
else
break;
// We could seek here
bestSeekDTS = pic.dts;
seekToFrameIdx = pic.frame;
}
else
break;
}

return {bestSeekDTS, seekToFrameIdx};
Expand Down

0 comments on commit dfe95b9

Please sign in to comment.