Commit Graph

42 Commits

Author SHA1 Message Date
Cosmin Dumitru
37b50fe13c Fix malformed query string in StreamInfo.ToUrl() causing 500 error via proxies
StreamInfo.ToUrl() generated URLs like `/master.m3u8?&DeviceId=...` (note `?&`)
because `?` was appended to the path and all parameters started with `&`. When
the first optional parameter (DeviceProfileId) was null, the result was a
malformed query string.

This is harmless when clients hit Jellyfin directly (ASP.NET Core tolerates `?&`),
but when accessed through a reverse proxy that parses and re-serializes the URL
(e.g. Home Assistant ingress via aiohttp/yarl), `?&` becomes `?=&` — introducing
an empty-key query parameter. ParseStreamOptions then crashes on `param.Key[0]`
with IndexOutOfRangeException.

Changes:
- StreamInfo.ToUrl(): Track query start position and replace the first `&` with
  `?` after all parameters are appended, producing valid query strings
- ParseStreamOptions: Guard against empty query parameter keys
- Tests: Remove .Replace("?&", "?") workaround that masked the bug

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:08:35 +01:00
Abitofevrything
8d052a6cb1 Merge pull request #15926 from abitofevrything/feat/accurate_hls_seeking
Refactor HLS transcode seeking
2026-01-18 12:17:06 +01:00
Dmitry Lyzo
940c4e8ba8 Add Dolby Vision tests for Tizen (#12670)
* Fix Tizen H264 profiles

* Add Dolby Vision tests for Tizen

* Allow Dolby Vision fallback layer on Tizen 3+
2025-03-31 17:45:14 -06:00
Bond-009
e9729a536f Use pattern matching for null checks (#13793)
Fix the few that slipped through
2025-03-31 17:38:25 -06:00
Tim Eisele
824bafc32d Fix StreamInfo.ToUrl (#13808) 2025-03-30 21:37:58 -06:00
Tim Eisele
9657708b38 Reduce allocations, simplifed code, faster implementation, included tests - StreamInfo.ToUrl (#9369)
* Rework PR 6168

* Fix test
2025-03-28 06:51:44 -06:00
Dmitry Lyzo
cb931e0062 Add profile condition to limit the number of streams (#13583) 2025-03-28 06:51:22 -06:00
Shadowghost
5a5da33f44 Apply review suggestions 2024-09-17 23:34:12 +02:00
Shadowghost
2351eeba56 Rework PR 6203 2024-09-17 20:35:23 +02:00
gnattu
ffbfd46dea Move progressive tests to old place 2024-09-14 03:28:14 +08:00
gnattu
118c583bff Add Dolby Vision testing
Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-14 01:23:41 +08:00
gnattu
b0e6c357f7 Restore progressive transcoding tests
Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-13 23:26:48 +08:00
gnattu
af92b4370f Fix safari test
Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-13 23:19:35 +08:00
gnattu
cefcbcb2ac Add mkv h264 ac3 tests
Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-13 23:17:33 +08:00
gnattu
edc15c8e92 Add broken fps mkv test
Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-13 18:20:07 +08:00
gnattu
6395f4889d Update unit test for StreamBuilder to reflect current server and clients
Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-13 15:44:03 +08:00
Dmitry Lyzo
3da081ba86 Add audio ranking for transcoding profiles (#12546) 2024-09-09 13:16:58 -06:00
gnattu
162ea38a95 Check MaxAudioChannels for directAudioStream candidates (#12319)
* Check MaxAudioChannels for directAudioStream candidates

The current stream builder logic does not check the channel limit when determining if the audio stream can be directly used, and this can cause some undesired effects:

- A high channel count surround sound stream might be picked even if a stereo one exists when the user requires stereo audio.

- The user's preferred audio codec might not be respected during the downmix because the requested codec is now forced to be the same as the original source.

Signed-off-by: gnattu <gnattuoc@me.com>

* Fix unit test

Signed-off-by: gnattu <gnattuoc@me.com>

* Set correct transcode reason and target channels for unit test

Signed-off-by: gnattu <gnattuoc@me.com>

* Match old stream selection behavior

Signed-off-by: gnattu <gnattuoc@me.com>

* Fix reason matching

Signed-off-by: gnattu <gnattuoc@me.com>

---------

Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-29 00:11:59 +02:00
Cody Robibero
e731250342 Lowercase MediaStreamProtocol for backwards compatibility 2024-03-08 15:29:22 -07:00
Niels van Velzen
407cf5d0bf Add MediaStreamProtocol enum (#10153)
* Add MediaStreamProtocol enum

* Add default handling for enum during deserialization

---------

Co-authored-by: Cody Robibero <cody@robibe.ro>
2024-03-04 16:44:54 -07:00
Dmitry Lyzo
e1ba9c0f42 test: drop default flag from second audio track
To test more general situation.
Add another HEVC test file with old logic.
2024-02-22 09:38:13 +03:00
Dmitry Lyzo
47b583456a test: collect candidate audio streams if no audio index is specified
To be consistent with the logic of StreamBuilder.
2024-02-22 09:37:59 +03:00
Dmitry Lyzo
07b9c85f14 test: discard webm from test mkvs if there is an unsupported codec (#10999)
To comply 39088b5ad2, ba877283a1
2024-02-12 07:34:26 -07:00
Dmitry Lyzo
ca280279da test: add more audio tests 2023-12-21 12:45:02 +03:00
Dmitry Lyzo
8c29fa422a test: fix tizen profile 2023-12-21 12:43:07 +03:00
Dmitry Lyzo
d92f2ac31c test: fix remux tests
This partially reverts commit 2d8f7b46f1
2023-12-21 12:38:58 +03:00
Bond-009
3087881d93 Merge pull request #10056 from Bond-009/nullable2 2023-09-12 11:09:20 +02:00
Lehonti Ramos
bc959270b7 Removed nesting levels through block-scoped using statement (#10025)
Co-authored-by: John Doe <john@doe>
Co-authored-by: Lehonti Ramos <lehonti@ramos>
2023-09-11 12:12:40 +02:00
Bond_009
5677566a41 Enable nullable for more files 2023-07-29 21:35:38 +02:00
Stepan Goremykin
890fe183cf Use default instead of zero for TranscodeReason 2023-04-10 01:44:56 +02:00
Stepan Goremykin
7d7e177265 Remove redundant casts 2023-04-06 19:17:28 +02:00
Dmitry Lyzo
28b98cacc8 Backport pull request #9051 from jellyfin/release-10.8.z
Fix transcode reasons

Original-merge: 1dea309ae4

Merged-by: Joshua M. Boniface <joshua@boniface.me>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2023-01-22 14:05:37 -05:00
Shadowghost
697efec86e Cleanup and refactor streambuilder 2022-12-07 18:00:01 +01:00
Bond_009
52194f56b5 Replace != null with is not null 2022-12-05 15:01:13 +01:00
Bond_009
c7d50d640e Replace == null with is null 2022-12-05 15:00:20 +01:00
Bond_009
556cc8062d Investigate some TODO comments 2022-11-27 14:13:31 +01:00
Dmitry Lyzo
c7a9759a76 fix tests 2022-10-31 15:51:06 +03:00
Joshua M. Boniface
2d8f7b46f1 Merge pull request #7699 from Shadowghost/streambuilder-fix
(cherry picked from commit b46d61dfdf)
Signed-off-by: crobibero <cody@robibe.ro>
2022-05-20 18:30:57 -04:00
Cody Robibero
688553b9a8 Merge pull request #7537 from dmitrylyzo/fix-streambuilder
(cherry picked from commit 5833c70725)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
2022-04-17 15:45:10 -04:00
Cody Robibero
1960b5bdce Merge pull request #7523 from crobibero/null-stream
Allow media without streams to playback 

(cherry picked from commit 577325b788)
Signed-off-by: crobibero <cody@robibe.ro>
2022-04-07 12:54:58 -04:00
Bond-009
bb7068cb63 Move StreamBuilderTests to correct project (#7461) 2022-03-18 22:19:02 +01:00
Bond_009
39931fe3ad Add regression test for ContainerProfile.ContainsContainer 2021-05-05 13:33:34 +02:00