Check if the mediainfo has bitrate before using it.
This commit is contained in:
parent
da102ae302
commit
817c30635e
1 changed files with 6 additions and 1 deletions
|
@ -138,7 +138,12 @@ MainDisplay::setMediainfo (const Xmms::PropDict &info)
|
|||
}
|
||||
m_text->setText (n);
|
||||
|
||||
m_kbps->setNumber (info.get<int32_t> ("bitrate")/1000, 3);
|
||||
if (info.contains ("bitrate")) {
|
||||
m_kbps->setNumber (info.get<int32_t> ("bitrate")/1000, 3);
|
||||
} else {
|
||||
m_kbps->setNumber (0, 1);
|
||||
}
|
||||
|
||||
if (info.contains ("samplerate")) {
|
||||
m_khz->setNumber (info.get<int32_t> ("samplerate")/1000, 2);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue