aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2024-08-27 22:24:34 +0200
committerGitHub <noreply@github.com>2024-08-27 22:24:34 +0200
commit6281cd707dae40a26c419c0069fd22f494d50f7f (patch)
tree84d4a49bc42b993ff2ed88f39736f8b08fb44719 /Emby.Server.Implementations/Data
parented572467aab96d6149c85dc0d0b406bc6c5106e2 (diff)
parentd4472074896a8ed3f66a6eb2c7cd438b97787ae4 (diff)
Merge pull request #11250 from nyanmisaka/fix-hwa-video-rotation
Fix the broken video orientation (+-90/180)
Diffstat (limited to 'Emby.Server.Implementations/Data')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 5094dcf0d..60f5ee47a 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -183,7 +183,8 @@ namespace Emby.Server.Implementations.Data
"ElPresentFlag",
"BlPresentFlag",
"DvBlSignalCompatibilityId",
- "IsHearingImpaired"
+ "IsHearingImpaired",
+ "Rotation"
};
private static readonly string _mediaStreamSaveColumnsInsertQuery =
@@ -343,7 +344,7 @@ namespace Emby.Server.Implementations.Data
base.Initialize();
const string CreateMediaStreamsTableCommand
- = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, ColorPrimaries TEXT NULL, ColorSpace TEXT NULL, ColorTransfer TEXT NULL, DvVersionMajor INT NULL, DvVersionMinor INT NULL, DvProfile INT NULL, DvLevel INT NULL, RpuPresentFlag INT NULL, ElPresentFlag INT NULL, BlPresentFlag INT NULL, DvBlSignalCompatibilityId INT NULL, IsHearingImpaired BIT NULL, PRIMARY KEY (ItemId, StreamIndex))";
+ = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, ColorPrimaries TEXT NULL, ColorSpace TEXT NULL, ColorTransfer TEXT NULL, DvVersionMajor INT NULL, DvVersionMinor INT NULL, DvProfile INT NULL, DvLevel INT NULL, RpuPresentFlag INT NULL, ElPresentFlag INT NULL, BlPresentFlag INT NULL, DvBlSignalCompatibilityId INT NULL, IsHearingImpaired BIT NULL, Rotation INT NULL, PRIMARY KEY (ItemId, StreamIndex))";
const string CreateMediaAttachmentsTableCommand
= "create table if not exists mediaattachments (ItemId GUID, AttachmentIndex INT, Codec TEXT, CodecTag TEXT NULL, Comment TEXT NULL, Filename TEXT NULL, MIMEType TEXT NULL, PRIMARY KEY (ItemId, AttachmentIndex))";
@@ -538,6 +539,8 @@ namespace Emby.Server.Implementations.Data
AddColumn(connection, "MediaStreams", "IsHearingImpaired", "BIT", existingColumnNames);
+ AddColumn(connection, "MediaStreams", "Rotation", "INT", existingColumnNames);
+
connection.Execute(string.Join(';', postQueries));
transaction.Commit();
@@ -5483,6 +5486,8 @@ AND Type = @InternalPersonType)");
statement.TryBind("@DvBlSignalCompatibilityId" + index, stream.DvBlSignalCompatibilityId);
statement.TryBind("@IsHearingImpaired" + index, stream.IsHearingImpaired);
+
+ statement.TryBind("@Rotation" + index, stream.Rotation);
}
statement.ExecuteNonQuery();
@@ -5694,6 +5699,11 @@ AND Type = @InternalPersonType)");
item.IsHearingImpaired = reader.TryGetBoolean(43, out var result) && result;
+ if (reader.TryGetInt32(44, out var rotation))
+ {
+ item.Rotation = rotation;
+ }
+
if (item.Type is MediaStreamType.Audio or MediaStreamType.Subtitle)
{
item.LocalizedDefault = _localization.GetLocalizedString("Default");