Diffstat (limited to 'core/multimedia/opieplayer/wavplugin/wavplugin.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/wavplugin.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp index 7ac63c0..4a0da16 100644 --- a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp +++ b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp | |||
@@ -67,13 +67,13 @@ public: | |||
67 | max = out = sound_buffer_size; | 67 | max = out = sound_buffer_size; |
68 | wavedata_remaining = 0; | 68 | wavedata_remaining = 0; |
69 | samples_due = 0; | 69 | samples_due = 0; |
70 | samples = -1; | 70 | samples = -1; |
71 | } | 71 | } |
72 | 72 | ||
73 | // expands out samples to the frequency of 44kHz | 73 | // expands out samples to the frequency of 44kHz //not any more |
74 | bool add( short *output, long count, long& done, bool stereo ) | 74 | bool add( short *output, long count, long& done, bool stereo ) |
75 | { | 75 | { |
76 | done = 0; | 76 | done = 0; |
77 | qApp->processEvents(); | 77 | qApp->processEvents(); |
78 | 78 | ||
79 | if ( input == 0 ) { | 79 | if ( input == 0 ) { |
@@ -85,12 +85,14 @@ public: | |||
85 | int l,r; | 85 | int l,r; |
86 | if ( getSample(l, r) == FALSE ) { | 86 | if ( getSample(l, r) == FALSE ) { |
87 | qDebug("didn't get sample"); | 87 | qDebug("didn't get sample"); |
88 | return FALSE; | 88 | return FALSE; |
89 | } | 89 | } |
90 | samples_due += chunkdata.samplesPerSec; | 90 | samples_due += chunkdata.samplesPerSec; |
91 | printf("samples due %d\r", samples_due); | ||
92 | fflush(stdout); | ||
91 | while ( count && (samples_due > chunkdata.samplesPerSec) ) { | 93 | while ( count && (samples_due > chunkdata.samplesPerSec) ) { |
92 | *output++ = l; | 94 | *output++ = l; |
93 | if ( stereo ) | 95 | if ( stereo ) |
94 | *output++ = r; | 96 | *output++ = r; |
95 | samples_due -= chunkdata.samplesPerSec; | 97 | samples_due -= chunkdata.samplesPerSec; |
96 | count--; | 98 | count--; |
@@ -325,16 +327,16 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl | |||
325 | bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) { | 327 | bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) { |
326 | // qDebug( "WavPlugin::audioReadSamples" ); | 328 | // qDebug( "WavPlugin::audioReadSamples" ); |
327 | return d->add( output, samples, samplesMade, channels != 1 ); | 329 | return d->add( output, samples, samplesMade, channels != 1 ); |
328 | } | 330 | } |
329 | 331 | ||
330 | double WavPlugin::getTime() { | 332 | double WavPlugin::getTime() { |
331 | // qDebug( "WavPlugin::getTime" ); | 333 | // qDebug( "WavPlugin::getTime" ); //this is a stupid hack here!! |
332 | return 0.0; | 334 | return d->chunkdata.wBitsPerSample; /*0.0*/; |
333 | } | 335 | } |
334 | 336 | ||
335 | int WavPlugin::audioBitsPerSample( int ) { | 337 | // int WavPlugin::audioBitsPerSample( int ) { |
336 | // qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample ); | 338 | // // qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample ); |
337 | return d->chunkdata.wBitsPerSample; // | 339 | // return d->chunkdata.wBitsPerSample; // |
338 | } | 340 | // } |
339 | 341 | ||
340 | 342 | ||