Use correct frame sizes when calculating length of MPEG 2 or 2.5 streams.

CCBUG:130185


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@740177 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský
2007-11-22 18:55:47 +00:00
parent e06495a7e3
commit 46fbd11d8f
5 changed files with 37 additions and 2 deletions

View File

@ -13,6 +13,7 @@ SET(test_runner_SRCS
main.cpp
test_list.cpp
test_map.cpp
test_mpeg.cpp
test_synchdata.cpp
test_bytevector.cpp
test_string.cpp

View File

@ -10,6 +10,7 @@ test_runner_SOURCES = \
main.cpp \
test_list.cpp \
test_map.cpp \
test_mpeg.cpp \
test_synchdata.cpp \
test_bytevector.cpp \
test_string.cpp \

BIN
tests/data/mpeg2.mp3 Normal file

Binary file not shown.

25
tests/test_mpeg.cpp Normal file
View File

@ -0,0 +1,25 @@
#include <cppunit/extensions/HelperMacros.h>
#include <string>
#include <stdio.h>
#include <mpegfile.h>
using namespace std;
using namespace TagLib;
class TestMPEG : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestMPEG);
CPPUNIT_TEST(testVersion2DurationWithXingHeader);
CPPUNIT_TEST_SUITE_END();
public:
void testVersion2DurationWithXingHeader()
{
MPEG::File f("data/mpeg2.mp3");
CPPUNIT_ASSERT_EQUAL(5387, f.audioProperties()->length());
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestMPEG);