diff options
| -rw-r--r-- | flake.nix | 3 | ||||
| -rw-r--r-- | src/buffer/volume.h | 19 | ||||
| -rw-r--r-- | src/codec/ffmpeg/decoder.c | 4 | ||||
| -rw-r--r-- | src/fruits/ctv/ctv.c | 2 | ||||
| -rw-r--r-- | src/fruits/droid/ctv/gradle/libs.versions.toml | 2 | ||||
| -rw-r--r-- | src/libsink/sink.c | 7 | ||||
| -rw-r--r-- | src/screen/screen.c | 4 | ||||
| -rw-r--r-- | subprojects/SPIRV-Cross.wrap | 4 | ||||
| -rw-r--r-- | subprojects/libplacebo.wrap | 4 | ||||
| -rw-r--r-- | subprojects/packagefiles/BLAKE3/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | subprojects/packagefiles/ffmpeg/meson.build | 2 | ||||
| -rw-r--r-- | subprojects/shaderc.wrap | 4 |
12 files changed, 32 insertions, 24 deletions
@@ -318,7 +318,8 @@ abiVersions = [ "armeabi-v7a" "arm64-v8a" ]; cmakeVersions = [ cmakeVersion ]; includeNDK = true; - ndkVersions = ["23.2.8568313"]; + # latest = 28.0.13004108, _counted_by conflict. + ndkVersion = "23.2.8568313"; useGoogleAPIs = false; useGoogleTVAddOns = false; includeExtras = [ "extras;google;gcm" ]; diff --git a/src/buffer/volume.h b/src/buffer/volume.h index 87b1945..7d10e6d 100644 --- a/src/buffer/volume.h +++ b/src/buffer/volume.h @@ -1,10 +1,10 @@ #include "../codec/codec.h" -static inline f32 apply_volume_f32(f32 *data, size_t sample_count, s32 channel_count, f32 volume, f32 user, f32 step) +static inline f32 apply_volume_f32(f32 *data, size_t sample_count, s32 channel_count, f32 volume, f32 limit, f32 step) { for (u32 i = 0; i < sample_count; i++) { if (step != 0.f && i % channel_count == 0) { - volume = CLAMP(volume + step, 0.f, user); + volume = CLAMP(volume + step, 0.f, limit); } f64 sample = (f64)data[i]; sample *= volume; @@ -13,11 +13,11 @@ static inline f32 apply_volume_f32(f32 *data, size_t sample_count, s32 channel_c return volume; } -static inline f32 apply_volume_s32(s32 *data, size_t sample_count, s32 channel_count, f32 volume, f32 user, f32 step) +static inline f32 apply_volume_s32(s32 *data, size_t sample_count, s32 channel_count, f32 volume, f32 limit, f32 step) { for (u32 i = 0; i < sample_count; i++) { if (step != 0.f && i % channel_count == 0) { - volume = CLAMP(volume + step, 0.f, user); + volume = CLAMP(volume + step, 0.f, limit); } f64 sample = (f64)data[i]; sample *= volume; @@ -26,11 +26,11 @@ static inline f32 apply_volume_s32(s32 *data, size_t sample_count, s32 channel_c return volume; } -static inline f32 apply_volume_s16(s16 *data, size_t sample_count, s32 channel_count, f32 volume, f32 user, f32 step) +static inline f32 apply_volume_s16(s16 *data, size_t sample_count, s32 channel_count, f32 volume, f32 limit, f32 step) { for (u32 i = 0; i < sample_count; i++) { if (step != 0.f && i % channel_count == 0) { - volume = CLAMP(volume + step, 0.f, user); + volume = CLAMP(volume + step, 0.f, limit); } f64 sample = (f64)data[i]; sample *= volume; @@ -42,19 +42,20 @@ static inline f32 apply_volume_s16(s16 *data, size_t sample_count, s32 channel_c static inline f32 apply_volume(u8 *data, size_t size, struct camu_audio_format *fmt, f32 volume, f32 user, f32 step) { size_t sample_count; + f32 limit = MAX(user, volume); switch (camu_audio_format_bytes_per_sample(fmt)) { case 4: sample_count = size / 4; if (fmt->format == CAMU_SAMPLE_FORMAT_S32) { - return apply_volume_s32((s32 *)data, sample_count, fmt->channel_count, volume, user, step); + return apply_volume_s32((s32 *)data, sample_count, fmt->channel_count, volume, limit, step); } else if (fmt->format == CAMU_SAMPLE_FORMAT_FLT) { - return apply_volume_f32((f32 *)data, sample_count, fmt->channel_count, volume, user, step); + return apply_volume_f32((f32 *)data, sample_count, fmt->channel_count, volume, limit, step); } break; case 2: sample_count = size / 2; if (fmt->format == CAMU_SAMPLE_FORMAT_S16) { - return apply_volume_s16((s16 *)data, sample_count, fmt->channel_count, volume, user, step); + return apply_volume_s16((s16 *)data, sample_count, fmt->channel_count, volume, limit, step); } break; } diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c index 1675433..e22f184 100644 --- a/src/codec/ffmpeg/decoder.c +++ b/src/codec/ffmpeg/decoder.c @@ -3,12 +3,12 @@ #include <al/lib.h> #include <libavutil/cpu.h> +#include "decoder.h" + #if !defined CAMU_SINK_NO_VIDEO && defined CAMU_FF_DECODER_HWACCEL #include "../../render/renderer.h" #endif -#include "decoder.h" - #ifdef CAMU_FF_DECODER_HWACCEL #if defined CAMU_RENDERER_VULKAN static const char *hwdevces[] = { "vulkan" }; diff --git a/src/fruits/ctv/ctv.c b/src/fruits/ctv/ctv.c index 55ab773..804cbed 100644 --- a/src/fruits/ctv/ctv.c +++ b/src/fruits/ctv/ctv.c @@ -26,7 +26,7 @@ static nn_thread_result NNWT_THREADCALL event_loop_thread(void *userdata) prefs->audio_lang = CAMU_LANG_ENGLISH; prefs->subtitle_lang = CAMU_LANG_ENGLISH; - if (!camu_desktop_connect(&c->desktop, &c->loop, NNWT_SOCKET_TCP, &CAMU_TEST_ADDR, CAMU_PORT)) { + if (!camu_desktop_connect(&c->desktop, &c->loop, CAMU_TEST_TYPE, &CAMU_TEST_ADDR, CAMU_PORT)) { return 0; } diff --git a/src/fruits/droid/ctv/gradle/libs.versions.toml b/src/fruits/droid/ctv/gradle/libs.versions.toml index 6869a38..4a8d0bc 100644 --- a/src/fruits/droid/ctv/gradle/libs.versions.toml +++ b/src/fruits/droid/ctv/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.9.0" +agp = "8.9.1" [libraries] diff --git a/src/libsink/sink.c b/src/libsink/sink.c index fe87df5..2b9d585 100644 --- a/src/libsink/sink.c +++ b/src/libsink/sink.c @@ -469,10 +469,14 @@ static void mixer_callback(void *userdata, u8 op) if (op == CAMU_MIXER_EMPTY) { log_info("Mixer empty."); #ifndef LIANA_LIST_SCUFFED_LOOP + // We need to sync with do_add_entry() because the order of + // the START/STOP's in the queue matters. + nn_mutex_lock(&sink->lock); queue_cmd(sink, (struct camu_sink_cmd){ .op = STOP, .value.i = CAMU_SINK_AUDIO }); + nn_mutex_unlock(&sink->lock); #else (void)sink; #endif @@ -1643,7 +1647,8 @@ void camu_sink_seek(struct camu_sink *sink, void *value, u8 mode) } case CAMU_SEEK_RELATIVE: { f64 offset = *(f64 *)value; - cmd.value.u = (u64)((pts + offset) * 1000000); + pts = MAX(pts + offset, 0.0); + cmd.value.u = (u64)(pts * 1000000); break; } case CAMU_SEEK_PERCENT: { diff --git a/src/screen/screen.c b/src/screen/screen.c index 155668e..0e44dcd 100644 --- a/src/screen/screen.c +++ b/src/screen/screen.c @@ -225,8 +225,8 @@ static bool key_callback(void *userdata, u8 state, u16 button) case STELA_KEY_E: scr->callback(scr->userdata, CAMU_SCREEN_RESEEK, NULL); break; - case STELA_KEY_V: { - f32 volume = 1.0; + case STELA_KEY_M: { + f32 volume = SCREEN_MOD1(scr) ? 1.f : 0.f; scr->callback(scr->userdata, CAMU_SCREEN_SET_VOLUME, &volume); break; } diff --git a/subprojects/SPIRV-Cross.wrap b/subprojects/SPIRV-Cross.wrap index 815c29b..672cb44 100644 --- a/subprojects/SPIRV-Cross.wrap +++ b/subprojects/SPIRV-Cross.wrap @@ -1,6 +1,6 @@ [wrap-git] -directory = SPIRV-Cross-9daa7fe +directory = SPIRV-Cross-ccff428 url = https://github.com/KhronosGroup/SPIRV-Cross.git -revision = 9daa7fe0a36dbe5c5b810d74d2cc43b202407d57 +revision = ccff428086b625241de9f225dab0a53269b4d12c depth = 1 method = cmake diff --git a/subprojects/libplacebo.wrap b/subprojects/libplacebo.wrap index d84d8ea..d9a2165 100644 --- a/subprojects/libplacebo.wrap +++ b/subprojects/libplacebo.wrap @@ -1,7 +1,7 @@ [wrap-git] -directory = libplacebo-563ea4a +directory = libplacebo-2bd627f url = https://code.videolan.org/videolan/libplacebo.git -revision = 563ea4a1a23237c0acd9f0ba29f5166ebcd5cf60 +revision = 2bd627f823ba1cedbc51a0ee6eb7a9fb433d912e clone-recursive = true depth = 1 diff --git a/subprojects/packagefiles/BLAKE3/CMakeLists.txt b/subprojects/packagefiles/BLAKE3/CMakeLists.txt index 20bc4cc..75b4aea 100644 --- a/subprojects/packagefiles/BLAKE3/CMakeLists.txt +++ b/subprojects/packagefiles/BLAKE3/CMakeLists.txt @@ -1 +1,2 @@ +cmake_minimum_required(VERSION 3.9 FATAL_ERROR) add_subdirectory(c) diff --git a/subprojects/packagefiles/ffmpeg/meson.build b/subprojects/packagefiles/ffmpeg/meson.build index f50f30f..71b539b 100644 --- a/subprojects/packagefiles/ffmpeg/meson.build +++ b/subprojects/packagefiles/ffmpeg/meson.build @@ -85,7 +85,7 @@ elif is_windows #hwaccels += ',h264_dxva2,hevc_dxva2,av1_dxva2,vp9_dxva2' elif is_android extra_options += ['--enable-jni', '--enable-mediacodec'] - decoders += ',h264_mediacodec,hevc_mediacodec,av1_mediacodec' + decoders += ',h264_mediacodec,hevc_mediacodec,av1_mediacodec,vp9_mediacodec' elif is_linux extra_options += ['--enable-vaapi'] endif diff --git a/subprojects/shaderc.wrap b/subprojects/shaderc.wrap index bbe5980..575308b 100644 --- a/subprojects/shaderc.wrap +++ b/subprojects/shaderc.wrap @@ -1,7 +1,7 @@ [wrap-git] -directory = shaderc-acc976a +directory = shaderc-0ab6bf5 url = https://github.com/google/shaderc.git -revision = acc976a6a92d37694afdf1e2bda80ce8c83ef75a +revision = 0ab6bf5cefea23cf985ce6296a293170132984ae depth = 1 method = cmake patch_directory = shaderc |