src/audio/SDL_audio.c
changeset 3096 ae4e80dbe330
parent 3040 62d4992e5a92
child 3099 82e60908fab1
equal deleted inserted replaced
3095:75483112b97f 3096:ae4e80dbe330
   470 
   470 
   471                 /* Now read from the streamer */
   471                 /* Now read from the streamer */
   472                 SDL_StreamRead(&device->streamer, stream, stream_len);
   472                 SDL_StreamRead(&device->streamer, stream, stream_len);
   473 
   473 
   474                 /* Ready current buffer for play and change current buffer */
   474                 /* Ready current buffer for play and change current buffer */
   475                 if (stream != device->fake_stream) {
   475                 if (stream != device->fake_stream && !device->paused) {
   476                     current_audio.impl.PlayDevice(device);
   476                     current_audio.impl.PlayDevice(device);
   477                 }
   477                     /* Wait for an audio buffer to become available */
   478 
   478                     current_audio.impl.WaitDevice(device);
   479                 /* Wait for an audio buffer to become available */
       
   480                 if (stream == device->fake_stream) {
       
   481                     SDL_Delay((device->spec.samples * 1000) /
       
   482                               device->spec.freq);
       
   483                 } else {
   479                 } else {
   484                     current_audio.impl.WaitDevice(device);
   480                     SDL_Delay((device->spec.samples * 1000) / device->spec.freq);
   485                 }
   481                 }
   486             }
   482             }
   487 
   483 
   488         }
   484         }
   489     } else {
   485     } else {
   522                 SDL_memcpy(stream, device->convert.buf,
   518                 SDL_memcpy(stream, device->convert.buf,
   523                            device->convert.len_cvt);
   519                            device->convert.len_cvt);
   524             }
   520             }
   525 
   521 
   526             /* Ready current buffer for play and change current buffer */
   522             /* Ready current buffer for play and change current buffer */
   527             if (stream != device->fake_stream) {
   523             if (stream != device->fake_stream && !device->paused) {
   528                 current_audio.impl.PlayDevice(device);
   524                 current_audio.impl.PlayDevice(device);
   529             }
   525                 /* Wait for an audio buffer to become available */
   530 
   526                 current_audio.impl.WaitDevice(device);
   531             /* Wait for an audio buffer to become available */
       
   532             if (stream == device->fake_stream) {
       
   533                 SDL_Delay((device->spec.samples * 1000) / device->spec.freq);
       
   534             } else {
   527             } else {
   535                 current_audio.impl.WaitDevice(device);
   528             	SDL_Delay((device->spec.samples * 1000) / device->spec.freq);
   536             }
   529             }
   537         }
   530         }
   538     }
   531     }
   539 
   532 
   540     /* Wait for the audio to drain.. */
   533     /* Wait for the audio to drain.. */