Skip to content

Commit

Permalink
[Domain] Some videos may have a level < 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Jan 8, 2021
1 parent d808cb3 commit 8bbd8c5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CastIt.Domain/Models/FFmpeg/Info/FileInfoStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ public class FileInfoStream
[JsonProperty(PropertyName = "sample_rate")]
public long SampleRate { get; set; }

[JsonProperty(PropertyName = "nb_frames")]
public long NumberOfFrames { get; set; }

[JsonProperty(PropertyName = "tags")]
public FileInfoTag Tag { get; set; }

//The CodecType in an audio returns may return video if the stream is a png img
//The CodecType in an audio file may return video if the stream is a png img
public bool IsVideo
=> CodecType == "video" && Level > 0;
=> CodecType == "video" && Level != 0 && NumberOfFrames > 1;

public bool IsAudio
=> CodecType == "audio";
Expand Down

0 comments on commit 8bbd8c5

Please sign in to comment.