summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/StreamUtils.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
committermanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
commitbe933ef2241d79558f91796cc5b3a161f72ebf9c (patch)
treefe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/StreamUtils.cpp
parent5f8335c1e49ce108ef3481863833c98efa00411b (diff)
downloadkodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip
sync with upstream
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}