From 341bb024227a1be91a00fbaf0a30ee44d915e342 Mon Sep 17 00:00:00 2001 From: gnattu Date: Thu, 6 Feb 2025 22:15:29 +0800 Subject: [PATCH] Order MediaStream query by StreamIndex (#13506) Our stream index calculation logic implemented in #7529, assumes an in-order array. However, our current query may return out-of-order items, leading the server to pass an incorrect index to ffmpeg, causing the transcoding to crash. --- Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs index d6bfc1a8f7..6ba8a62b56 100644 --- a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs +++ b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs @@ -88,7 +88,7 @@ public class MediaStreamRepository : IMediaStreamRepository query = query.Where(e => e.StreamType == typeValue); } - return query; + return query.OrderBy(e => e.StreamIndex); } private MediaStream Map(MediaStreamInfo entity)