From 80e640c072b80590b3cc818e25a80589f515f4a4 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 25 Feb 2009 07:33:21 +0100 Subject: factor our audio stuff from dxr3interface.h With this commit ALSA support is only some commits away. This commit introduces cAudioOss, which has everything needed in it to handle a oss audio device. There are some problems, which will fixed soon. For instance, external mode is not supported at the moment. --- dxr3output-audio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'dxr3output-audio.c') diff --git a/dxr3output-audio.c b/dxr3output-audio.c index af1a879..34064cf 100644 --- a/dxr3output-audio.c +++ b/dxr3output-audio.c @@ -106,11 +106,18 @@ void cDxr3AudioOutThread::Action() void cDxr3AudioOutThread::PlayFrame(cFixedLengthFrame *frame) { + // update audio context + SampleContext ctx; + ctx.samplerate = frame->GetSampleRate(); + ctx.channels = frame->GetChannelCount(); + audioOutput->setup(ctx); + + // volume changes if (!cDxr3Interface::Instance().IsAudioModeAC3()) { audioOutput->changeVolume((short *)frame->GetData(), (size_t)frame->GetCount()); } - m_dxr3Device.PlayAudioFrame(frame); + audioOutput->write(frame->GetData(), frame->GetCount()); } #undef SCR -- cgit v1.2.3