summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/StreamUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/utils/StreamUtils.cpp')
-rw-r--r--xbmc/utils/StreamUtils.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/xbmc/utils/StreamUtils.cpp b/xbmc/utils/StreamUtils.cpp
new file mode 100644
index 0000000..bd34fec
--- /dev/null
+++ b/xbmc/utils/StreamUtils.cpp
@@ -0,0 +1,32 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#include "StreamUtils.h"
10
11int StreamUtils::GetCodecPriority(const std::string &codec)
12{
13 /*
14 * Technically flac, truehd, and dtshd_ma are equivalently good as they're all lossless. However,
15 * ffmpeg can't decode dtshd_ma losslessy yet.
16 */
17 if (codec == "flac") // Lossless FLAC
18 return 7;
19 if (codec == "truehd") // Dolby TrueHD
20 return 6;
21 if (codec == "dtshd_ma") // DTS-HD Master Audio (previously known as DTS++)
22 return 5;
23 if (codec == "dtshd_hra") // DTS-HD High Resolution Audio
24 return 4;
25 if (codec == "eac3") // Dolby Digital Plus
26 return 3;
27 if (codec == "dca") // DTS
28 return 2;
29 if (codec == "ac3") // Dolby Digital
30 return 1;
31 return 0;
32}