PageRenderTime 15ms CodeModel.GetById 8ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/utils/StreamUtils.cpp

http://github.com/xbmc/xbmc
C++ | 32 lines | 19 code | 2 blank | 11 comment | 14 complexity | 3e94924d75dc5acb3fbc4f118a44a252 MD5 | raw file
 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}