Reduce code duplication via MediaFileInfo::overallAverageBitrate()

This commit is contained in:
Martchus 2019-03-10 16:32:56 +01:00
parent 814580a895
commit fb04ee4e12
3 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ set(META_GUI_OPTIONAL true)
set(META_JS_SRC_DIR renamingutility)
set(META_VERSION_MAJOR 3)
set(META_VERSION_MINOR 2)
set(META_VERSION_PATCH 0)
set(META_VERSION_PATCH 1)
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
# add project files
@ -180,7 +180,7 @@ if (WIDGETS_GUI OR QUICK_GUI)
endif ()
# find tagparser
find_package(tagparser 8.1.0 REQUIRED)
find_package(tagparser 8.3.0 REQUIRED)
use_tag_parser()
list(APPEND TEST_LIBRARIES ${TAG_PARSER_SHARED_LIB})

View File

@ -278,7 +278,7 @@ void FileInfoModel::updateCache()
const TimeSpan duration = m_file->duration();
if (!duration.isNull()) {
rootHelper.appendRow(tr("Duration"), duration);
rootHelper.appendRow(tr("Overall avg. bitrate"), bitrateToString(0.0078125 * m_file->size() / duration.totalSeconds()));
rootHelper.appendRow(tr("Overall avg. bitrate"), bitrateToString(m_file->overallAverageBitrate()));
}
const char *const mimeType = m_file->mimeType();
if (*mimeType) {

View File

@ -913,7 +913,7 @@ public:
if (!duration.isNull()) {
m_rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Duration"), qstr(duration.toString(TimeSpanOutputFormat::WithMeasures)));
m_rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Overall avg. bitrate"),
qstr(bitrateToString(0.0078125 * m_file.size() / duration.totalSeconds())));
qstr(bitrateToString(m_file.overallAverageBitrate())));
}
const char *const mimeType = m_file.mimeType();
if (*mimeType) {