diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-02-21 17:59:40 +0100 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-02-21 17:59:40 +0100 |
commit | 2d405ad8011283e20c50d63eb47741cd5dbcc5c7 (patch) | |
tree | 49c8559b39f48d8368d31784442ac4b2b6263dcf /dxr3output-audio.c | |
parent | f686d1cc06b0f6251f882087820d685cff0c90be (diff) | |
download | vdr-plugin-dxr3-2d405ad8011283e20c50d63eb47741cd5dbcc5c7.tar.gz vdr-plugin-dxr3-2d405ad8011283e20c50d63eb47741cd5dbcc5c7.tar.bz2 |
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.
Diffstat (limited to 'dxr3output-audio.c')
-rw-r--r-- | dxr3output-audio.c | 13 |
1 files changed, 10 insertions, 3 deletions
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 <stdio.h> #include <time.h> #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: |