Commit 6d5a76aa authored by Scott Wheeler's avatar Scott Wheeler

Fixed some segfaulting that was happening when I tried to use the audiodata

when the MPEG parse failed.

svn path=/trunk/kdemultimedia/juk/; revision=163887
parent c5ecba68
......@@ -166,7 +166,6 @@ bool AudioData::headCheck(unsigned long head)
int AudioData::getBitrate(){
return (bitrates[version][layer - 1][bitrate_index]);
}
int AudioData::getSamplerate(){
......@@ -199,17 +198,18 @@ int AudioData::getLength() {
}
char* AudioData::getLengthChar() {
int min, sec;
char buf[6];
min=length/60;
sec=length%60;
/* if (sec < 10)
sprintf (buf, "%d:0%d", min, sec);
else */
sprintf (buf, "%d:%02d", min, sec);
lengthchar=strdup (buf);
return lengthchar;
if(success) {
int min, sec;
char buf[6];
min=length/60;
sec=length%60;
sprintf (buf, "%d:%02d", min, sec);
lengthchar=strdup (buf);
return lengthchar;
}
else
return 0;
}
int AudioData::getSize() {
......
......@@ -380,6 +380,10 @@ void TaggerWidget::updateBoxes() // this needs to be updated to properly work wi
lengthBox->setText(audioData->getLengthChar());
bitrateBox->setText(QString::number(audioData->getBitrate()));
}
else {
lengthBox->setText(QString::null);
bitrateBox->setText(QString::null);
}
commentBox->setText(tag->getComment());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment