1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-08 16:11:14 +02:00

Bug2606: Import shouldn't be lossy or narrower than Quality pref

This commit is contained in:
Paul Licameli 2020-12-03 14:58:06 -05:00
parent 31b391737f
commit f4f8194dc6
2 changed files with 5 additions and 5 deletions

View File

@ -516,7 +516,7 @@ ProgressResult FFmpegImportFileHandle::Import(WaveTrackFactory *trackFactory,
sc->m_initialchannels = sc->m_stream->codec->channels;
stream.resize(sc->m_stream->codec->channels);
for (auto &channel : stream)
channel = trackFactory->NewWaveTrack(sc->m_osamplefmt, sc->m_stream->codec->sample_rate);
channel = NewWaveTrack(*trackFactory, sc->m_osamplefmt, sc->m_stream->codec->sample_rate);
}
// Handles the start_time by creating silence. This may or may not be correct.

View File

@ -64,7 +64,6 @@ static Importer::RegisteredUnusableImportPlugin registered
#include "../Prefs.h"
#include "../Tags.h"
#include "../WaveTrack.h"
#include "../prefs/QualityPrefs.h"
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/ProgressDialog.h"
@ -1034,11 +1033,12 @@ enum mad_flow MP3ImportFileHandle::OutputCB(struct mad_header const * WXUNUSED(h
mChannels.resize(mNumChannels);
auto format = QualityPrefs::SampleFormatChoice();
for (auto &channel: mChannels)
{
channel = mTrackFactory->NewWaveTrack(format, pcm->samplerate);
// Mad library header explains the 32 bit fixed point format with
// 28 fractional bits. Effective sample format must therefore be
// more than 24, and this is our only choice now.
channel = NewWaveTrack(*mTrackFactory, floatSample, pcm->samplerate);
}
}