diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/BUILDDATE kodi-20.0+git20220717.0300-efc833a06d/BUILDDATE --- kodi-20.0+git20220715.0300-9bcb8c6a31/BUILDDATE 2013-05-12 08:41:54.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/BUILDDATE 2013-05-12 08:41:54.000000000 +0000 @@ -1 +1 @@ -20220715 +20220717 diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/cmake/installdata/test-reference-data.txt kodi-20.0+git20220717.0300-efc833a06d/cmake/installdata/test-reference-data.txt --- kodi-20.0+git20220715.0300-9bcb8c6a31/cmake/installdata/test-reference-data.txt 2013-05-12 08:41:54.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/cmake/installdata/test-reference-data.txt 2013-05-12 08:41:54.000000000 +0000 @@ -25,5 +25,12 @@ xbmc/network/test/data/test.html xbmc/network/test/data/test.png xbmc/playlists/test/test.xspf +xbmc/video/test/testdata/moviestack_ab/Movie-(2001)/Movie-(2001)A.mp4 +xbmc/video/test/testdata/moviestack_ab/Movie-(2001)/Movie-(2001)B.mp4 +xbmc/video/test/testdata/moviestack_part/Movie_(2001)/Movie_(2001)_part1.mkv +xbmc/video/test/testdata/moviestack_part/Movie_(2001)/Movie_(2001)_part2.mkv +xbmc/video/test/testdata/moviestack_part/Movie_(2001)/Movie_(2001)_part3.mkv +xbmc/video/test/testdata/moviestack_dvdiso/Movie_(2001)/Movie_(2001)_dvd1.iso +xbmc/video/test/testdata/moviestack_dvdiso/Movie_(2001)/Movie_(2001)_dvd2.iso xbmc/utils/test/CXBMCTinyXML-test.xml xbmc/utils/test/data/language/Spanish/strings.po diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/debian/changelog kodi-20.0+git20220717.0300-efc833a06d/debian/changelog --- kodi-20.0+git20220715.0300-9bcb8c6a31/debian/changelog 2013-05-12 08:41:54.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/debian/changelog 2013-05-12 08:41:54.000000000 +0000 @@ -1,4 +1,4 @@ -kodi (6:20.0+git20220715.0300-9bcb8c6a31-0~impish) impish; urgency=medium +kodi (6:20.0+git20220717.0300-efc833a06d-0~impish) impish; urgency=medium [ kodi ] * autogenerated dummy changelog diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/VERSION kodi-20.0+git20220717.0300-efc833a06d/VERSION --- kodi-20.0+git20220715.0300-9bcb8c6a31/VERSION 2013-05-12 08:41:54.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/VERSION 2013-05-12 08:41:54.000000000 +0000 @@ -1 +1 @@ -9bcb8c6a31 +efc833a06d diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/guilib/GUIFontTTF.cpp kodi-20.0+git20220717.0300-efc833a06d/xbmc/guilib/GUIFontTTF.cpp --- kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/guilib/GUIFontTTF.cpp 2013-05-12 08:41:54.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/xbmc/guilib/GUIFontTTF.cpp 2013-05-12 08:41:54.000000000 +0000 @@ -363,7 +363,6 @@ } Begin(); - std::vector glyphs = GetHarfBuzzShapedGlyphs(text); uint32_t rawAlignment = alignment; bool dirtyCache(false); bool hardwareClipping = m_renderSystem->ScissorsCanEffectClipping(); @@ -389,6 +388,7 @@ std::chrono::steady_clock::now(), dirtyCache)); if (dirtyCache) { + const std::vector glyphs = GetHarfBuzzShapedGlyphs(text); // save the origin, which is scaled separately m_originX = x; m_originY = y; @@ -575,12 +575,12 @@ float CGUIFontTTF::GetTextWidthInternal(const vecText& text) { - std::vector glyphs = GetHarfBuzzShapedGlyphs(text); + const std::vector glyphs = GetHarfBuzzShapedGlyphs(text); return GetTextWidthInternal(text, glyphs); } // this routine assumes a single line (i.e. it was called from GUITextLayout) -float CGUIFontTTF::GetTextWidthInternal(const vecText& text, std::vector& glyphs) +float CGUIFontTTF::GetTextWidthInternal(const vecText& text, const std::vector& glyphs) { float width = 0; for (auto it = glyphs.begin(); it != glyphs.end(); it++) diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/guilib/GUIFontTTF.h kodi-20.0+git20220717.0300-efc833a06d/xbmc/guilib/GUIFontTTF.h --- kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/guilib/GUIFontTTF.h 2013-05-12 08:41:54.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/xbmc/guilib/GUIFontTTF.h 2013-05-12 08:41:54.000000000 +0000 @@ -151,7 +151,7 @@ std::vector GetHarfBuzzShapedGlyphs(const vecText& text); float GetTextWidthInternal(const vecText& text); - float GetTextWidthInternal(const vecText& text, std::vector& glyph); + float GetTextWidthInternal(const vecText& text, const std::vector& glyph); float GetCharWidthInternal(character_t ch); float GetTextHeight(float lineSpacing, int numLines) const; float GetTextBaseLine() const { return static_cast(m_cellBaseLine); } diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/video/test/CMakeLists.txt kodi-20.0+git20220717.0300-efc833a06d/xbmc/video/test/CMakeLists.txt --- kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/video/test/CMakeLists.txt 2013-05-12 08:41:54.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/xbmc/video/test/CMakeLists.txt 2013-05-12 08:41:54.000000000 +0000 @@ -1,3 +1,4 @@ -set(SOURCES TestVideoInfoScanner.cpp) +set(SOURCES TestStacks.cpp + TestVideoInfoScanner.cpp) core_add_test_library(video_test) diff -Nru kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/video/test/TestStacks.cpp kodi-20.0+git20220717.0300-efc833a06d/xbmc/video/test/TestStacks.cpp --- kodi-20.0+git20220715.0300-9bcb8c6a31/xbmc/video/test/TestStacks.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kodi-20.0+git20220717.0300-efc833a06d/xbmc/video/test/TestStacks.cpp 2013-05-12 08:41:54.000000000 +0000 @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2022 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#include "FileItem.h" +#include "filesystem/Directory.h" +#include "test/TestUtils.h" + +#include + +#include + +using namespace XFILE; + +namespace +{ +const std::string VIDEO_EXTENSIONS = ".mpg|.mpeg|.mp4|.mkv|.mk3d|.iso"; +} + +class TestStacks : public ::testing::Test +{ +protected: + TestStacks() = default; + ~TestStacks() override = default; +}; + +TEST_F(TestStacks, TestMovieFilesStackFilesAB) +{ + const std::string movieFolder = + XBMC_REF_FILE_PATH("xbmc/video/test/testdata/moviestack_ab/Movie-(2001)"); + CFileItemList items; + CDirectory::GetDirectory(movieFolder, items, VIDEO_EXTENSIONS, DIR_FLAG_DEFAULTS); + // make sure items has 2 items (the two movie parts) + EXPECT_EQ(items.Size(), 2); + // stack the items and make sure we end up with a single movie + items.Stack(); + EXPECT_EQ(items.Size(), 1); + // check the single item in the stack is a stack:// + EXPECT_EQ(items.Get(0)->IsStack(), true); +} + +TEST_F(TestStacks, TestMovieFilesStackFilesPart) +{ + const std::string movieFolder = + XBMC_REF_FILE_PATH("xbmc/video/test/testdata/moviestack_part/Movie_(2001)"); + CFileItemList items; + CDirectory::GetDirectory(movieFolder, items, VIDEO_EXTENSIONS, DIR_FLAG_DEFAULTS); + // make sure items has 3 items (the three movie parts) + EXPECT_EQ(items.Size(), 3); + // stack the items and make sure we end up with a single movie + items.Stack(); + EXPECT_EQ(items.Size(), 1); + // check the single item in the stack is a stack:// + EXPECT_EQ(items.Get(0)->IsStack(), true); +} + +TEST_F(TestStacks, TestMovieFilesStackDvdIso) +{ + const std::string movieFolder = + XBMC_REF_FILE_PATH("xbmc/video/test/testdata/moviestack_dvdiso/Movie_(2001)"); + CFileItemList items; + CDirectory::GetDirectory(movieFolder, items, VIDEO_EXTENSIONS, DIR_FLAG_DEFAULTS); + // make sure items has 2 items (the two dvd isos) + EXPECT_EQ(items.Size(), 2); + // stack the items and make sure we end up with a single movie + items.Stack(); + EXPECT_EQ(items.Size(), 1); + // check the single item in the stack is a stack:// + EXPECT_EQ(items.Get(0)->IsStack(), true); +}