From 2d405ad8011283e20c50d63eb47741cd5dbcc5c7 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Sat, 21 Feb 2009 17:59:40 +0100 Subject: first work to get alsa audio output Introduce a iAudio class - will be later base class for oss and alas output -, which handles volume and channel handling. --- dxr3output-audio.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'dxr3output-audio.c') diff --git a/dxr3output-audio.c b/dxr3output-audio.c index ca01ea3..f267003 100644 --- a/dxr3output-audio.c +++ b/dxr3output-audio.c @@ -22,6 +22,7 @@ #include #include #include "dxr3output.h" +#include "dxr3audio.h" // ================================== const int AUDIO_OFFSET = 4500; @@ -73,7 +74,7 @@ void cDxr3AudioOutThread::Action() if (pts && (pts < SCR) && ((SCR - pts) > 5000)) { m_dxr3Device.SetSysClock(pts + 1 * AUDIO_OFFSET); - m_dxr3Device.PlayAudioFrame(pNext); + PlayFrame(pNext); if (m_buffer.IsPolled()) { m_buffer.Clear(); @@ -82,7 +83,7 @@ void cDxr3AudioOutThread::Action() } else { - m_dxr3Device.PlayAudioFrame(pNext); + PlayFrame(pNext); m_buffer.Pop(); } } @@ -90,7 +91,7 @@ void cDxr3AudioOutThread::Action() { if (abs((int)pts - (int)SCR) < (AUDIO_OFFSET )) { - m_dxr3Device.PlayAudioFrame(pNext); + PlayFrame(pNext); m_buffer.Pop(); } } @@ -103,6 +104,12 @@ void cDxr3AudioOutThread::Action() } } +void cDxr3AudioOutThread::PlayFrame(cFixedLengthFrame *frame) +{ + audioOutput->changeVolume((short *)frame->GetData(), (size_t)frame->GetCount()); + m_dxr3Device.PlayAudioFrame(frame); +} + #undef SCR // Local variables: -- cgit v1.2.3