Skip to content

Commit

Permalink
Cleanup AudioOutputBase::OutputAudioLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
jyavenard committed May 7, 2011
1 parent 519b692 commit 390164c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions mythtv/libs/libmyth/audio/audiooutputbase.cpp
Expand Up @@ -1518,16 +1518,13 @@ void AudioOutputBase::OutputAudioLoop(void)
uchar *zeros = new uchar[fragment_size];
uchar *fragment_buf = new uchar[fragment_size + 16];
uchar *fragment = (uchar *)AOALIGN(fragment_buf[0]);
memset(zeros, 0, fragment_size);

// to reduce startup latency, write silence in 8ms chunks
int zero_fragment_size = (int)(0.008*samplerate/channels);
// make sure its a multiple of output_bytes_per_frame
zero_fragment_size *= output_bytes_per_frame;
int zero_fragment_size = 8 * samplerate * output_bytes_per_frame / 1000;
if (zero_fragment_size > fragment_size)
zero_fragment_size = fragment_size;

memset(zeros, 0, fragment_size);


while (!killaudio)
{
if (pauseaudio)
Expand All @@ -1543,8 +1540,6 @@ void AudioOutputBase::OutputAudioLoop(void)
actually_paused = true;
audiotime = 0; // mark 'audiotime' as invalid.

// only send zeros if card doesn't already have at least one
// fragment of zeros -dag
WriteAudio(zeros, zero_fragment_size);
continue;
}
Expand Down

0 comments on commit 390164c

Please sign in to comment.