mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 21:08:27 +01:00
Add MediaStream.ReferenceFrameRate for problematic video files (#12603)
Co-authored-by: Nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
@@ -525,6 +525,23 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <value>The real frame rate.</value>
|
||||
public float? RealFrameRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the framerate used as reference.
|
||||
/// Prefer AverageFrameRate, if that is null or an unrealistic value
|
||||
/// then fallback to RealFrameRate.
|
||||
/// </summary>
|
||||
/// <value>The reference frame rate.</value>
|
||||
public float? ReferenceFrameRate
|
||||
{
|
||||
get
|
||||
{
|
||||
// In some cases AverageFrameRate for videos will be read as 1000fps even if it is not.
|
||||
// This is probably due to a library compatability issue.
|
||||
// See https://github.com/jellyfin/jellyfin/pull/12603#discussion_r1748044018 for more info.
|
||||
return AverageFrameRate < 1000 ? AverageFrameRate : RealFrameRate;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the profile.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user