[PR #15644] [CLOSED] Fix: Prevent crash in GetOutputFileExtension for streams without URL extension #14371

Closed
opened 2026-02-07 07:28:45 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/15644
Author: @martenumberto
Created: 11/27/2025
Status: Closed

Base: release-10.11.zHead: fix-streams-without-fileextensions


📝 Commits (10+)

  • 0b04ddb Bump version to 10.12.0
  • 8acfa92 Translated using Weblate (Marathi)
  • d8f8c94 Translated using Weblate (Spanish (Mexico))
  • 321df41 Translated using Weblate (Hindi)
  • 5f714cf Translated using Weblate (Punjabi)
  • 18f9954 Translated using Weblate (Korean)
  • 0e77c36 Update GitHub Artifact Actions
  • c3ea328 Update github/codeql-action action to v4.31.0
  • 5236d15 Translated using Weblate (Mongolian)
  • 14ead3b Update danielpalme/ReportGenerator-GitHub-Action action to v5.4.18

📊 Changes

27 files changed (+131 additions, -91 deletions)

View changed files

📝 .config/dotnet-tools.json (+1 -1)
📝 .github/CODEOWNERS (+11 -4)
📝 .github/ISSUE_TEMPLATE/issue report.yml (+4 -1)
📝 .github/workflows/ci-codeql-analysis.yml (+5 -5)
📝 .github/workflows/ci-compat.yml (+8 -8)
📝 .github/workflows/ci-openapi.yml (+12 -12)
📝 .github/workflows/ci-tests.yml (+3 -3)
📝 .github/workflows/commands.yml (+3 -3)
📝 .github/workflows/issue-template-check.yml (+2 -2)
📝 .github/workflows/release-bump-version.yaml (+2 -2)
📝 CONTRIBUTORS.md (+1 -0)
📝 Directory.Packages.props (+30 -30)
📝 Emby.Server.Implementations/Localization/Core/es-MX.json (+1 -1)
📝 Emby.Server.Implementations/Localization/Core/et.json (+1 -1)
📝 Emby.Server.Implementations/Localization/Core/gsw.json (+1 -1)
📝 Emby.Server.Implementations/Localization/Core/hi.json (+8 -1)
📝 Emby.Server.Implementations/Localization/Core/ko.json (+3 -1)
📝 Emby.Server.Implementations/Localization/Core/mn.json (+3 -3)
📝 Emby.Server.Implementations/Localization/Core/mr.json (+6 -1)
📝 Emby.Server.Implementations/Localization/Core/pa.json (+4 -2)

...and 7 more files

📄 Description

Describe the changes

This PR adds a defensive fallback to Jellyfin.Api.Helpers.StreamingHelpers.GetOutputFileExtension.

When handling a video request where:

  1. The URL does not contain a file extension (common in IPTV/M3U streams with tokens),
  2. The video codec is not in the hardcoded list (e.g. mpeg2video),
  3. And the MediaSource.Container is not yet populated (due to race conditions during initial probing),

...the server currently throws an InvalidOperationException, resulting in an HTTP 500 error and playback failure.

This change adds a default fallback to .ts (Transport Stream) for video requests when no other extension can be determined. This allows the stream to be passed to ffmpeg for remuxing/transcoding instead of crashing the request.

Fixes

Fixes https://github.com/jellyfin/jellyfin/issues/15643
We should considering backport to 10.11.x

How to test

  1. Add an M3U Tuner with streams that do not have a file extension in the URL (e.g., http://provider/stream/12345?token=abc).
  2. Ensure the stream uses a codec not explicitly handled in StreamingHelpers (e.g., mpeg2video) or trigger a cold start where probing data is missing.
  3. Attempt to play the stream.
  4. Before this fix: Server logs show System.InvalidOperationException: Failed to find an appropriate file extension and playback fails.
  5. After this fix: Playback starts successfully (typically remuxing to TS).

Checklist

  • I have read the contributing guidelines.
  • I have verified that the change works locally.
  • The code follows the project's coding standards.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/15644 **Author:** [@martenumberto](https://github.com/martenumberto) **Created:** 11/27/2025 **Status:** ❌ Closed **Base:** `release-10.11.z` ← **Head:** `fix-streams-without-fileextensions` --- ### 📝 Commits (10+) - [`0b04ddb`](https://github.com/jellyfin/jellyfin/commit/0b04ddb1c2db531dfcc5eb838945a819f426df33) Bump version to 10.12.0 - [`8acfa92`](https://github.com/jellyfin/jellyfin/commit/8acfa92467266750f8505f5216ac697aed1eb169) Translated using Weblate (Marathi) - [`d8f8c94`](https://github.com/jellyfin/jellyfin/commit/d8f8c94d6702a3a71149c19504d1bd3c13722bbc) Translated using Weblate (Spanish (Mexico)) - [`321df41`](https://github.com/jellyfin/jellyfin/commit/321df41b9805854234c665e3c9f6dd44edcb3a72) Translated using Weblate (Hindi) - [`5f714cf`](https://github.com/jellyfin/jellyfin/commit/5f714cf40dfc7607710ad5c11a12dd5d1d0d1058) Translated using Weblate (Punjabi) - [`18f9954`](https://github.com/jellyfin/jellyfin/commit/18f995477ae94d94f8c9043f0063c16bd366c866) Translated using Weblate (Korean) - [`0e77c36`](https://github.com/jellyfin/jellyfin/commit/0e77c364db876a0fdbd3241a00635fc56ac16ebd) Update GitHub Artifact Actions - [`c3ea328`](https://github.com/jellyfin/jellyfin/commit/c3ea3282d1a082a5eb7a37035bdb3dae0be6c5c0) Update github/codeql-action action to v4.31.0 - [`5236d15`](https://github.com/jellyfin/jellyfin/commit/5236d158a08ea3226ceb5080abdfda0e269b8af9) Translated using Weblate (Mongolian) - [`14ead3b`](https://github.com/jellyfin/jellyfin/commit/14ead3b8a737686e19958245eaf0662829152f86) Update danielpalme/ReportGenerator-GitHub-Action action to v5.4.18 ### 📊 Changes **27 files changed** (+131 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `.config/dotnet-tools.json` (+1 -1) 📝 `.github/CODEOWNERS` (+11 -4) 📝 `.github/ISSUE_TEMPLATE/issue report.yml` (+4 -1) 📝 `.github/workflows/ci-codeql-analysis.yml` (+5 -5) 📝 `.github/workflows/ci-compat.yml` (+8 -8) 📝 `.github/workflows/ci-openapi.yml` (+12 -12) 📝 `.github/workflows/ci-tests.yml` (+3 -3) 📝 `.github/workflows/commands.yml` (+3 -3) 📝 `.github/workflows/issue-template-check.yml` (+2 -2) 📝 `.github/workflows/release-bump-version.yaml` (+2 -2) 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `Directory.Packages.props` (+30 -30) 📝 `Emby.Server.Implementations/Localization/Core/es-MX.json` (+1 -1) 📝 `Emby.Server.Implementations/Localization/Core/et.json` (+1 -1) 📝 `Emby.Server.Implementations/Localization/Core/gsw.json` (+1 -1) 📝 `Emby.Server.Implementations/Localization/Core/hi.json` (+8 -1) 📝 `Emby.Server.Implementations/Localization/Core/ko.json` (+3 -1) 📝 `Emby.Server.Implementations/Localization/Core/mn.json` (+3 -3) 📝 `Emby.Server.Implementations/Localization/Core/mr.json` (+6 -1) 📝 `Emby.Server.Implementations/Localization/Core/pa.json` (+4 -2) _...and 7 more files_ </details> ### 📄 Description ### Describe the changes This PR adds a defensive fallback to `Jellyfin.Api.Helpers.StreamingHelpers.GetOutputFileExtension`. When handling a video request where: 1. The URL does not contain a file extension (common in IPTV/M3U streams with tokens), 2. The video codec is not in the hardcoded list (e.g. `mpeg2video`), 3. And the `MediaSource.Container` is not yet populated (due to race conditions during initial probing), ...the server currently throws an `InvalidOperationException`, resulting in an HTTP 500 error and playback failure. This change adds a default fallback to `.ts` (Transport Stream) for video requests when no other extension can be determined. This allows the stream to be passed to ffmpeg for remuxing/transcoding instead of crashing the request. ### Fixes Fixes https://github.com/jellyfin/jellyfin/issues/15643 We should considering backport to 10.11.x ### How to test 1. Add an M3U Tuner with streams that do not have a file extension in the URL (e.g., `http://provider/stream/12345?token=abc`). 2. Ensure the stream uses a codec not explicitly handled in `StreamingHelpers` (e.g., `mpeg2video`) or trigger a cold start where probing data is missing. 3. Attempt to play the stream. 4. **Before this fix:** Server logs show `System.InvalidOperationException: Failed to find an appropriate file extension` and playback fails. 5. **After this fix:** Playback starts successfully (typically remuxing to TS). ### Checklist - [x] I have read the contributing guidelines. - [x] I have verified that the change works locally. - [x] The code follows the project's coding standards. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:28:45 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14371