diff options
author | metamuffin <metamuffin@disroot.org> | 2025-04-21 10:15:46 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-04-21 10:15:46 +0200 |
commit | 9b9f5abedb69c4ecb6cae7ecc27f53ee7e9fe5d4 (patch) | |
tree | e42a5cf3ceec261fb6e2918c0fed0f0af37c485a | |
parent | 82fc75dcea8f26f23eec0c6e88244e41b401a826 (diff) | |
download | jellything-9b9f5abedb69c4ecb6cae7ecc27f53ee7e9fe5d4.tar jellything-9b9f5abedb69c4ecb6cae7ecc27f53ee7e9fe5d4.tar.bz2 jellything-9b9f5abedb69c4ecb6cae7ecc27f53ee7e9fe5d4.tar.zst |
fix bitrate min max bug
-rw-r--r-- | stream/src/stream_info.rs | 2 | ||||
-rw-r--r-- | web/script/player/track/mse.ts | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/stream/src/stream_info.rs b/stream/src/stream_info.rs index 43d9289..3a33b46 100644 --- a/stream/src/stream_info.rs +++ b/stream/src/stream_info.rs @@ -128,7 +128,7 @@ fn stream_formats(t: &TrackEntry, remux_bitrate: f64) -> Vec<StreamFormatInfo> { if enable { formats.push(StreamFormatInfo { codec: cid.to_string(), - bitrate: remux_bitrate.max(br), + bitrate: remux_bitrate.min(br), remux: false, containers: containers_by_codec(cid), width: Some(w), diff --git a/web/script/player/track/mse.ts b/web/script/player/track/mse.ts index c69833b..343799e 100644 --- a/web/script/player/track/mse.ts +++ b/web/script/player/track/mse.ts @@ -108,7 +108,7 @@ export class MSEPlayerTrack extends PlayerTrack { this.active_format.value = this.usable_formats[ai - 1] } if (prev_format != this.active_format.value) { - console.log(`${show.metric(prev_format.format.bitrate)} -> ${this.active_format.value.format.bitrate}`); + console.log(`abr ${show.metric(prev_format.format.bitrate)} -> ${show.metric(this.active_format.value.format.bitrate)}`); this.choose_format() } } @@ -157,6 +157,7 @@ export class MSEPlayerTrack extends PlayerTrack { async load(index: number) { this.choose_format() this.loading.add(index); + this.update_buf_ranges() // TODO update format selection const url = `${this.base_url}?fragment&segment=${this.segment_index}&track=${this.track_index}&format=${this.active_format.value!.format_index}&index=${index}&container=${this.active_format.value!.container}`; const buf = await this.player.downloader.download(url); |