Browse Source

sndio: do not prepend zeroes

This is not a good idea if the stream is playing.
pull/2/head
Rémi Denis-Courmont 15 years ago
parent
commit
37a1cbee1c
  1. 15
      modules/audio_output/sndio.c

15
modules/audio_output/sndio.c

@ -167,20 +167,7 @@ static void Play (audio_output_t *aout, block_t *block)
mtime_t delay = par.bufsz * CLOCK_FREQ / aout->format.i_rate;
delay = block->i_pts - (mdate () - delay);
if (delay > 0)
{
size_t frames = (delay * aout->format.i_rate) / CLOCK_FREQ;
msg_Dbg (aout, "prepending %zu zeroes", frames);
void *pad = calloc (frames, aout->format.i_bytes_per_frame);
if (likely(pad != NULL))
{
sio_write (sio, pad, frames * aout->format.i_bytes_per_frame);
free (pad);
}
}
else
aout_TimeReport (aout, block->i_pts - delay);
aout_TimeReport (aout, block->i_pts - delay);
}
while (block->i_buffer > 0 && !sio_eof (sio))

Loading…
Cancel
Save