Skip to content

Commit 0f26f17

Browse files
committed
Fix unreliable codec detection for DTS audio streams
1 parent 7b0115a commit 0f26f17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ff-utils-winforms/Media/FfmpegUtils.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public static async Task<List<Stream>> GetStreams(string path, bool progressBar,
7676
string lang = await GetFfprobeInfoAsync(path, showStreams, "TAG:language", idx);
7777
string title = await GetFfprobeInfoAsync(path, showStreams, "TAG:title", idx);
7878
string codec = await GetFfprobeInfoAsync(path, showStreams, "codec_name", idx);
79-
if(codec.ToLower() == "dts") codec = await GetFfprobeInfoAsync(path, showStreams, "profile", idx);
79+
string profile = await GetFfprobeInfoAsync(path, showStreams, "profile", idx);
80+
if (codec.ToLower() == "dts" && profile != "unknown") codec = profile;
8081
string codecLong = await GetFfprobeInfoAsync(path, showStreams, "codec_long_name", idx);
8182
int kbits = (await GetFfprobeInfoAsync(path, showStreams, "bit_rate", idx)).GetInt() / 1024;
8283
int sampleRate = (await GetFfprobeInfoAsync(path, showStreams, "sample_rate", idx)).GetInt();

0 commit comments

Comments
 (0)