[Scummvm-git-logs] scummvm master -> aae703182ffaf9faf5540bcc3ffbca11734c2324
sev-
noreply at scummvm.org
Mon Mar 13 22:25:21 UTC 2023
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
21b4a8f9ec TVOS: IOS: Add libvpx to build
b45c386fc1 VIDEO: Add Tremor support to MKV decoder
bd4adcec66 CONFIGURE: Fix libvpx detection when it's static
aae703182f VIDEO: MKV: Make mkvparser not use STL
Commit: 21b4a8f9ecaee0c1906b639a2b00dc29886d3b2d
https://github.com/scummvm/scummvm/commit/21b4a8f9ecaee0c1906b639a2b00dc29886d3b2d
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-13T23:25:13+01:00
Commit Message:
TVOS: IOS: Add libvpx to build
Changed paths:
ports.mk
diff --git a/ports.mk b/ports.mk
index 5857c35ef2d..5f099112833 100644
--- a/ports.mk
+++ b/ports.mk
@@ -520,6 +520,10 @@ ifdef USE_A52
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/liba52.a
endif
+ifdef USE_VPX
+OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libvpx.a
+endif
+
ifdef USE_JPEG
OSX_STATIC_LIBS += $(STATICLIBPATH)/lib/libjpeg.a
endif
Commit: b45c386fc10032fa6471b838978954c71d271dad
https://github.com/scummvm/scummvm/commit/b45c386fc10032fa6471b838978954c71d271dad
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-13T23:25:13+01:00
Commit Message:
VIDEO: Add Tremor support to MKV decoder
Changed paths:
video/mkv_decoder.cpp
diff --git a/video/mkv_decoder.cpp b/video/mkv_decoder.cpp
index 1ec5e3bbac7..396569a8aaf 100644
--- a/video/mkv_decoder.cpp
+++ b/video/mkv_decoder.cpp
@@ -447,8 +447,18 @@ Audio::AudioStream *MKVDecoder::VorbisAudioTrack::getAudioStream() const {
return _audStream;
}
+#ifndef USE_TREMOR
+static double rint(double v) {
+ return floor(v + 0.5);
+}
+#endif
+
bool MKVDecoder::VorbisAudioTrack::decodeSamples(byte *frame, long size) {
+#ifdef USE_TREMOR
+ ogg_int32_t **pcm;
+#else
float **pcm;
+#endif
int32 numSamples = vorbis_synthesis_pcmout(&_vorbisDSP, &pcm);
@@ -461,10 +471,18 @@ bool MKVDecoder::VorbisAudioTrack::decodeSamples(byte *frame, long size) {
error("MKVDecoder::readNextPacket(): buffer allocation failed");
for (int32 i = 0; i < channels; i++) { /* It's faster in this order */
+#ifdef USE_TREMOR
+ ogg_int32_t *src = pcm[i];
+#else
float *src = pcm[i];
+#endif
short *dest = ((short *)buffer) + i;
for (int32 j = 0; j < numSamples; j++) {
+#ifdef USE_TREMOR
+ int val = (int)(src[j] >> 9);
+#else
int val = rint(src[j] * 32768.f);
+#endif
val = CLIP(val, -32768, 32767);
*dest = (short)val;
dest += channels;
Commit: bd4adcec66e0ad14b28d4bd5eae1fb4a85d29526
https://github.com/scummvm/scummvm/commit/bd4adcec66e0ad14b28d4bd5eae1fb4a85d29526
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-13T23:25:13+01:00
Commit Message:
CONFIGURE: Fix libvpx detection when it's static
Changed paths:
configure
diff --git a/configure b/configure
index bdac379960b..682b6971c6c 100755
--- a/configure
+++ b/configure
@@ -1337,6 +1337,7 @@ for ac_option in $@; do
arg=`echo $ac_option | cut -d '=' -f 2`
VPX_CFLAGS="-I$arg/include"
VPX_LIBS="-L$arg/lib"
+ VPX_STATIC_LIBS="-L$arg/lib"
;;
--with-faad-prefix=*)
arg=`echo $ac_option | cut -d '=' -f 2`
@@ -5328,6 +5329,7 @@ if test "$_vpx" = auto ; then
if test "$_pkg_config" = "yes" && $_pkgconfig --exists vpx; then
append_var VPX_LIBS "`$_pkgconfig --libs vpx`"
+ append_var VPX_STATIC_LIBS "`$_pkgconfig --static --libs vpx`"
append_var VPX_CFLAGS "`$_pkgconfig --cflags vpx`"
else
append_var VPX_LIBS "-lvpx"
@@ -5347,7 +5349,13 @@ int main(void) {
return 0;
}
EOF
- cc_check $VPX_CFLAGS $VPX_LIBS && _vpx=yes
+ cc_check_no_clean $VPX_CFLAGS $VPX_LIBS && _vpx=yes
+ # If it fails, try with static libs, it may help
+ if test "$_vpx" != "yes"; then
+ VPX_LIBS="$VPX_STATIC_LIBS"
+ cc_check_no_clean $VPX_CFLAGS $VPX_LIBS && _vpx=yes
+ fi
+ cc_check_clean
fi
if test "$_vpx" = yes ; then
append_var LIBS "$VPX_LIBS -lvpx"
Commit: aae703182ffaf9faf5540bcc3ffbca11734c2324
https://github.com/scummvm/scummvm/commit/aae703182ffaf9faf5540bcc3ffbca11734c2324
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-03-13T23:25:13+01:00
Commit Message:
VIDEO: MKV: Make mkvparser not use STL
Changed paths:
video/mkv/mkvparser.cpp
diff --git a/video/mkv/mkvparser.cpp b/video/mkv/mkvparser.cpp
index feadda1eeb6..71a19cd40a7 100644
--- a/video/mkv/mkvparser.cpp
+++ b/video/mkv/mkvparser.cpp
@@ -5,37 +5,24 @@
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
-#include "video/mkv/mkvparser.h"
-
-#if defined(_MSC_VER) && _MSC_VER < 1800
-#include <float.h> // _isnan() / _finite()
-#define MSC_COMPAT
-#endif
-#include <cassert>
-#include <cfloat>
-#include <climits>
-#include <cmath>
-#include <cstring>
-#include <memory>
-#include <new>
+#include "common/math.h"
+#include "common/ptr.h"
+#include "common/str.h"
+#include "video/mkv/mkvparser.h"
#include "video/mkv/webmids.h"
+#ifndef LLONG_MAX
+#define LLONG_MAX 9223372036854775807LL
+#endif
+
namespace mkvparser {
const long long kStringElementSizeLimit = 20 * 1000 * 1000;
const float MasteringMetadata::kValueNotPresent = FLT_MAX;
const long long Colour::kValueNotPresent = LLONG_MAX;
const float Projection::kValueNotPresent = FLT_MAX;
-#ifdef MSC_COMPAT
-inline bool isnan(double val) { return !!_isnan(val); }
-inline bool isinf(double val) { return !_finite(val); }
-#else
-inline bool isnan(double val) { return std::isnan(val); }
-inline bool isinf(double val) { return std::isinf(val); }
-#endif // MSC_COMPAT
-
template <typename Type>
Type* SafeArrayAlloc(unsigned long long num_elements,
unsigned long long element_size) {
@@ -281,7 +268,7 @@ long UnserializeFloat(IMkvReader* pReader, long long pos, long long size_,
result = d;
}
- if (mkvparser::isinf(result) || mkvparser::isnan(result))
+ if (isinf(result) || isnan(result))
return E_FILE_FORMAT_INVALID;
return 0;
@@ -4552,7 +4539,7 @@ int Track::Info::CopyStr(char* Info::*str, Info& dst_) const {
if (dst == NULL)
return -1;
- strcpy(dst, src);
+ Common::strlcpy(dst, src, len + 1);
return 0;
}
@@ -5018,7 +5005,7 @@ bool MasteringMetadata::Parse(IMkvReader* reader, long long mm_start,
if (!reader || *mm)
return false;
- std::unique_ptr<MasteringMetadata> mm_ptr(new MasteringMetadata());
+ Common::ScopedPtr<MasteringMetadata> mm_ptr(new MasteringMetadata());
if (!mm_ptr.get())
return false;
@@ -5107,7 +5094,7 @@ bool Colour::Parse(IMkvReader* reader, long long colour_start,
if (!reader || *colour)
return false;
- std::unique_ptr<Colour> colour_ptr(new Colour());
+ Common::ScopedPtr<Colour> colour_ptr(new Colour());
if (!colour_ptr.get())
return false;
@@ -5205,7 +5192,7 @@ bool Projection::Parse(IMkvReader* reader, long long start, long long size,
if (!reader || *projection)
return false;
- std::unique_ptr<Projection> projection_ptr(new Projection());
+ Common::ScopedPtr<Projection> projection_ptr(new Projection());
if (!projection_ptr.get())
return false;
@@ -5309,7 +5296,7 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
long long stereo_mode = 0;
double rate = 0.0;
- std::unique_ptr<char[]> colour_space_ptr;
+ Common::ScopedPtr<char, Common::ArrayDeleter<char>> colour_space_ptr;
IMkvReader* const pReader = pSegment->m_pReader;
@@ -5322,8 +5309,8 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
const long long stop = pos + s.size;
- std::unique_ptr<Colour> colour_ptr;
- std::unique_ptr<Projection> projection_ptr;
+ Common::ScopedPtr<Colour> colour_ptr;
+ Common::ScopedPtr<Projection> projection_ptr;
while (pos < stop) {
long long id, size;
More information about the Scummvm-git-logs
mailing list