~mkas/mixxx/mysql

« back to all changes in this revision

Viewing changes to mixxx/src/soundsourcemp3.cpp

  • Committer: MKas
  • Date: 2012-11-03 12:55:54 UTC
  • Revision ID: mkas@tux.lt-20121103125554-ez5ajqyk7bwehrp2
merge with trunk + sql fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
 
199
199
long SoundSourceMp3::seek(long filepos) {
200
200
    // Ensure that we are seeking to an even filepos
201
 
    Q_ASSERT(filepos%2==0);
 
201
    if (filepos % 2 != 0) {
 
202
        qDebug() << "SoundSourceMp3 got non-even seek target.";
 
203
        filepos--;
 
204
    }
202
205
 
203
206
    if (!isValid()) {
204
207
        return 0;
439
442
 
440
443
    // Ensure that we are reading an even number of samples. Otherwise this function may
441
444
    // go into an infinite loop
442
 
    Q_ASSERT(samples_wanted%2==0);
 
445
    if (samples_wanted % 2 != 0) {
 
446
        qDebug() << "SoundSourceMp3 got non-even samples_wanted";
 
447
        samples_wanted--;
 
448
    }
443
449
//     qDebug() << "frame list " << m_qSeekList.count();
444
450
 
445
451
    SAMPLE * destination = (SAMPLE *)_destination;
463
469
            else
464
470
                *(destination++) = madScale(Synth->pcm.samples[0][i]);
465
471
 
466
 
            // This is safe because we have Q_ASSERTed that samples_wanted is even.
 
472
            // This is safe because we have checked that samples_wanted is even.
467
473
            Total_samples_decoded += 2;
468
474
 
469
475
        }