mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 17:18:11 -04:00
MPEG: Properties::xingHeader() should return null if a VBR header is not found.
This commit is contained in:
parent
9ec6d28239
commit
f82be353b4
@ -178,10 +178,12 @@ void MPEG::Properties::read(File *file)
|
||||
|
||||
file->seek(first + 4);
|
||||
d->xingHeader = new XingHeader(file->readBlock(firstHeader.frameLength() - 4));
|
||||
if(!d->xingHeader->isValid()) {
|
||||
delete d->xingHeader;
|
||||
d->xingHeader = 0;
|
||||
}
|
||||
|
||||
if(d->xingHeader->isValid() &&
|
||||
firstHeader.samplesPerFrame() > 0 &&
|
||||
firstHeader.sampleRate() > 0) {
|
||||
if(d->xingHeader && firstHeader.samplesPerFrame() > 0 && firstHeader.sampleRate() > 0) {
|
||||
|
||||
// Read the length and the bitrate from the VBR header.
|
||||
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(64, f.audioProperties()->bitrate());
|
||||
CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->channels());
|
||||
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
|
||||
CPPUNIT_ASSERT(!f.audioProperties()->xingHeader()->isValid());
|
||||
CPPUNIT_ASSERT(!f.audioProperties()->xingHeader());
|
||||
|
||||
long last = f.lastFrameOffset();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user