Fixed the issue where trying to open a stream didin't reset the stream first.
This commit is contained in:
parent
bbfa3d5a76
commit
9d3024e13e
@ -95,7 +95,7 @@ SoundFileReader* SoundFileFactory::createReaderFromMemory(const void* data, std:
|
|||||||
MemoryInputStream stream;
|
MemoryInputStream stream;
|
||||||
stream.open(data, sizeInBytes);
|
stream.open(data, sizeInBytes);
|
||||||
|
|
||||||
// Test the filename in all the registered factories
|
// Test the stream for all the registered factories
|
||||||
for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
|
for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
|
||||||
{
|
{
|
||||||
stream.seek(0);
|
stream.seek(0);
|
||||||
@ -114,9 +114,10 @@ SoundFileReader* SoundFileFactory::createReaderFromStream(InputStream& stream)
|
|||||||
// Register the built-in readers/writers on first call
|
// Register the built-in readers/writers on first call
|
||||||
ensureDefaultReadersWritersRegistered();
|
ensureDefaultReadersWritersRegistered();
|
||||||
|
|
||||||
// Test the filename in all the registered factories
|
// Test the stream for all the registered factories
|
||||||
for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
|
for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
|
||||||
{
|
{
|
||||||
|
stream.seek(0);
|
||||||
if (it->check(stream))
|
if (it->check(stream))
|
||||||
return it->create();
|
return it->create();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user