From b610f9992f256ae4e62eabe2a32e079c7f5c58c1 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 9 Dec 2009 17:35:15 +0100 Subject: switching from analog to digital works again --- dxr3output-audio.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/dxr3output-audio.c b/dxr3output-audio.c index 5cb0e54..5588bc7 100644 --- a/dxr3output-audio.c +++ b/dxr3output-audio.c @@ -105,20 +105,22 @@ void cDxr3AudioOutThread::Action() void cDxr3AudioOutThread::PlayFrame(cFixedLengthFrame *frame) { - // update audio context - SampleContext ctx; - ctx.samplerate = frame->GetSampleRate(); - ctx.channels = frame->GetChannelCount(); - - // TODO find cause why we need this workaround - if (ctx.samplerate != -1 && ctx.channels != -1) { - audioOutput->setup(ctx); - } else { - dsyslog("[fixme] samplerate: %d channels: %d", ctx.samplerate, ctx.channels); - } + // only call setup and manipulate the volume for analog audio + if (!audioOutput->isDigitalAudio()) { + + // update audio context + SampleContext ctx; + ctx.samplerate = frame->GetSampleRate(); + ctx.channels = frame->GetChannelCount(); + + // TODO find cause why we need this workaround + if (ctx.samplerate != -1 && ctx.channels != -1) { + audioOutput->setup(ctx); + } else { + dsyslog("[fixme] samplerate: %d channels: %d", ctx.samplerate, ctx.channels); + } - // volume changes - if (!audio()->isAc3Dts()) { + // volume changes audioOutput->changeVolume((short *)frame->GetData(), (size_t)frame->GetCount()); } -- cgit v1.2.3