src/audio/SDL_audio.c
changeset 8658 7939f33e81ac
parent 8149 681eb46b8ac4
child 8660 6bd1f8bad873
equal deleted inserted replaced
8657:9be67c80e84e 8658:7939f33e81ac
   365 
   365 
   366     /* Calculate the delay while paused */
   366     /* Calculate the delay while paused */
   367     delay = ((device->spec.samples * 1000) / device->spec.freq);
   367     delay = ((device->spec.samples * 1000) / device->spec.freq);
   368 
   368 
   369     /* Determine if the streamer is necessary here */
   369     /* Determine if the streamer is necessary here */
       
   370 #if 0  /* !!! FIXME: rewrite/remove this streamer code. */
   370     if (device->use_streamer == 1) {
   371     if (device->use_streamer == 1) {
   371         /* This code is almost the same as the old code. The difference is, instead of reading
   372         /* This code is almost the same as the old code. The difference is, instead of reading
   372            directly from the callback into "stream", then converting and sending the audio off,
   373            directly from the callback into "stream", then converting and sending the audio off,
   373            we go: callback -> "istream" -> (conversion) -> streamer -> stream -> device.
   374            we go: callback -> "istream" -> (conversion) -> streamer -> stream -> device.
   374            However, reading and writing with streamer are done separately:
   375            However, reading and writing with streamer are done separately:
   454                 }
   455                 }
   455             }
   456             }
   456 
   457 
   457         }
   458         }
   458     } else {
   459     } else {
       
   460 #endif
   459         /* Otherwise, do not use the streamer. This is the old code. */
   461         /* Otherwise, do not use the streamer. This is the old code. */
   460         const int silence = (int) device->spec.silence;
   462         const int silence = (int) device->spec.silence;
   461 
   463 
   462         /* Loop, filling the audio buffers */
   464         /* Loop, filling the audio buffers */
   463         while (device->enabled) {
   465         while (device->enabled) {
   502                 current_audio.impl.WaitDevice(device);
   504                 current_audio.impl.WaitDevice(device);
   503             } else {
   505             } else {
   504                 SDL_Delay(delay);
   506                 SDL_Delay(delay);
   505             }
   507             }
   506         }
   508         }
   507     }
   509 #if 0  /* !!! FIXME: rewrite/remove this streamer code. */
       
   510     }
       
   511 #endif
   508 
   512 
   509     /* Wait for the audio to drain.. */
   513     /* Wait for the audio to drain.. */
   510     current_audio.impl.WaitDone(device);
   514     current_audio.impl.WaitDone(device);
   511 
   515 
   512     /* If necessary, deinit the streamer */
   516     /* If necessary, deinit the streamer */
       
   517 #if 0  /* !!! FIXME: rewrite/remove this streamer code. */
   513     if (device->use_streamer == 1)
   518     if (device->use_streamer == 1)
   514         SDL_StreamDeinit(&device->streamer);
   519         SDL_StreamDeinit(&device->streamer);
       
   520 #endif
   515 
   521 
   516     return (0);
   522     return (0);
   517 }
   523 }
   518 
   524 
   519 
   525