use pixel size as display size if display size not specified

This commit is contained in:
Martchus 2016-03-13 18:23:13 +01:00
parent 519b26b5b4
commit 56d13d326d
1 changed files with 11 additions and 0 deletions

View File

@ -358,6 +358,7 @@ void MatroskaTrack::internalParseHeader()
; ;
} }
} }
// read further information from the CodecPrivate element for some codecs // read further information from the CodecPrivate element for some codecs
switch(m_format.general) { switch(m_format.general) {
EbmlElement *codecPrivateElement; EbmlElement *codecPrivateElement;
@ -429,6 +430,8 @@ void MatroskaTrack::internalParseHeader()
default: default:
; ;
} }
// parse format name for unknown formats
if(m_format.general == GeneralMediaFormat::Unknown && m_formatName.empty()) { if(m_format.general == GeneralMediaFormat::Unknown && m_formatName.empty()) {
if(startsWith<string>(m_formatId, "V_") || startsWith<string>(m_formatId, "A_") || startsWith<string>(m_formatId, "S_")) { if(startsWith<string>(m_formatId, "V_") || startsWith<string>(m_formatId, "A_") || startsWith<string>(m_formatId, "S_")) {
m_formatName = m_formatId.substr(2); m_formatName = m_formatId.substr(2);
@ -437,6 +440,14 @@ void MatroskaTrack::internalParseHeader()
} }
m_formatName.append(" (unknown)"); m_formatName.append(" (unknown)");
} }
// use pixel size as display size if display size not specified
if(!m_displaySize.width()) {
m_displaySize.setWidth(m_pixelSize.width());
}
if(!m_displaySize.height()) {
m_displaySize.setHeight(m_pixelSize.height());
}
} }
} }