~ubuntu-branches/ubuntu/precise/lmms/precise-updates

« back to all changes in this revision

Viewing changes to src/core/sample_buffer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Артём Попов
  • Date: 2011-02-14 20:58:36 UTC
  • mfrom: (1.1.10 upstream) (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110214205836-2u41xus1d2mj8nfz
Tags: 0.4.10-1ubuntu1
* Merge from debian unstable (LP: #718801).  Remaining changes:
  - Replace build-dep on libwine-dev with wine1.2-dev to build
    against the newer Wine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * sample_buffer.cpp - container-class sampleBuffer
3
3
 *
4
 
 * Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
4
 * Copyright (c) 2005-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
5
 *
6
6
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
7
7
 *
184
184
                sample_rate_t samplerate = engine::getMixer()->baseSampleRate();
185
185
                m_frames = 0;
186
186
 
187
 
                if( QFileInfo( file ).size() > 100*1024*1024 )
 
187
                const QFileInfo fileInfo( file );
 
188
                if( fileInfo.size() > 100*1024*1024 )
188
189
                {
189
190
                        qWarning( "refusing to load sample files bigger "
190
191
                                                                "than 100 MB" );
192
193
                else
193
194
                {
194
195
 
 
196
#ifdef LMMS_HAVE_OGGVORBIS
 
197
                // workaround for a bug in libsndfile or our libsndfile decoder
 
198
                // causing some OGG files to be distorted -> try with OGG Vorbis
 
199
                // decoder first if filename extension matches "ogg"
 
200
                if( m_frames == 0 && fileInfo.suffix() == "ogg" )
 
201
                {
 
202
                        m_frames = decodeSampleOGGVorbis( f, buf, channels, samplerate );
 
203
                }
 
204
#endif
195
205
                if( m_frames == 0 )
196
206
                {
197
207
                        m_frames = decodeSampleSF( f, buf, channels,