// Look for TrueAudio metadata
if(readProperties) {
- seek(d->ID3v2Location + d->ID3v2OriginalSize);
- d->properties = new Properties(readBlock(TrueAudio::HeaderSize),
- length() - d->ID3v2OriginalSize);
+ if(d->ID3v2Location >= 0) {
+ seek(d->ID3v2Location + d->ID3v2OriginalSize);
+ d->properties = new Properties(readBlock(TrueAudio::HeaderSize),
+ length() - d->ID3v2OriginalSize);
+ }
+ else {
+ seek(0);
+ d->properties = new Properties(readBlock(TrueAudio::HeaderSize),
+ length());
+ }
}
}
void TrueAudio::Properties::read()
{
- if(!d->data.startsWith("TrueAudio"))
+ if(!d->data.startsWith("TTA"))
return;
int pos = 3;
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg/id3v2/frames
${CMAKE_CURRENT_SOURCE_DIR}/../taglib/mpeg
+ ${CMAKE_CURRENT_SOURCE_DIR}/../taglib/trueaudio
)
SET(test_runner_SRCS
test_map.cpp
test_mpeg.cpp
test_synchdata.cpp
+ test_trueaudio.cpp
test_bytevector.cpp
test_string.cpp
test_fileref.cpp
INCLUDES = \
-I$(top_srcdir)/taglib\
-I$(top_srcdir)/taglib/toolkit \
+ -I$(top_srcdir)/taglib/trueaudio \
-I$(top_srcdir)/taglib/mpeg \
-I$(top_srcdir)/taglib/mpeg/id3v1 \
-I$(top_srcdir)/taglib/mpeg/id3v2 \
test_map.cpp \
test_mpeg.cpp \
test_synchdata.cpp \
+ test_trueaudio.cpp \
test_bytevector.cpp \
test_string.cpp \
test_fileref.cpp \
--- /dev/null
+#include <cppunit/extensions/HelperMacros.h>
+#include <string>
+#include <stdio.h>
+#include <trueaudiofile.h>
+
+using namespace std;
+using namespace TagLib;
+
+class TestTrueAudio : public CppUnit::TestFixture
+{
+ CPPUNIT_TEST_SUITE(TestTrueAudio);
+ CPPUNIT_TEST(testReadPropertiesWithoutID3v2);
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+
+ void testReadPropertiesWithoutID3v2()
+ {
+ TrueAudio::File f("data/empty.tta");
+ CPPUNIT_ASSERT(f.audioProperties());
+ CPPUNIT_ASSERT_EQUAL(3, f.audioProperties()->length());
+ }
+
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestTrueAudio);