Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/analyzer/analyzerqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ void AnalyzerQueue::execThread() {
if (!pAudioSource) {
kLogger.warning()
<< "Failed to open file for analyzing:"
<< nextTrack->getLocation()
<< *pAudioSource;
<< nextTrack->getLocation();
emptyCheck();
continue;
}
Expand Down
22 changes: 20 additions & 2 deletions src/test/soundproxy_test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <QTemporaryFile>
#include <QtDebug>

#include "test/mixxxtest.h"
Expand Down Expand Up @@ -74,7 +75,7 @@ class SoundSourceProxyTest: public MixxxTest {
// to test the upscaling of channels
mixxx::AudioSource::OpenParams openParams;
openParams.setChannelCount(2);
auto pAudioSource = proxy.openAudioSource();
auto pAudioSource = proxy.openAudioSource(openParams);
EXPECT_FALSE(!pAudioSource);
if (pAudioSource->channelCount() != 2) {
// Wrap into proxy object
Expand Down Expand Up @@ -157,7 +158,7 @@ TEST_F(SoundSourceProxyTest, open) {
for (const auto& filePath: getFilePaths()) {
ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath));

mixxx::AudioSourcePointer pAudioSource(openAudioSource(filePath));
mixxx::AudioSourcePointer pAudioSource = openAudioSource(filePath);
// Obtaining an AudioSource may fail for unsupported file formats,
// even if the corresponding file extension is supported, e.g.
// AAC vs. ALAC in .m4a files
Expand All @@ -171,6 +172,23 @@ TEST_F(SoundSourceProxyTest, open) {
}
}

TEST_F(SoundSourceProxyTest, openEmptyFile) {
for (const auto& fileNameSuffix: getFileNameSuffixes()) {
QTemporaryFile tempFile("emptyXXXXXX" + fileNameSuffix);
qDebug() << "Created testing to open empty file:"
<< tempFile.fileName();
tempFile.open();
tempFile.close();

ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(tempFile.fileName()));
auto pTrack = Track::newTemporary(tempFile.fileName());
SoundSourceProxy proxy(pTrack);

auto pAudioSource = proxy.openAudioSource();
EXPECT_TRUE(!pAudioSource);
}
}

TEST_F(SoundSourceProxyTest, readArtist) {
auto pTrack = Track::newTemporary(
kTestDir.absoluteFilePath("artist.mp3"));
Expand Down