summaryrefslogtreecommitdiff
path: root/dxr3output-audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'dxr3output-audio.c')
-rw-r--r--dxr3output-audio.c13
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: