summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device.c30
-rw-r--r--device.h5
2 files changed, 26 insertions, 9 deletions
diff --git a/device.c b/device.c
index 942bd16e..b392e551 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c,v 1.3 2006-06-11 19:08:05 phintuka Exp $
+ * $Id: device.c,v 1.4 2006-07-02 17:09:04 phintuka Exp $
*
*/
@@ -1016,14 +1016,16 @@ void cXinelibDevice::SetAudioTrackDevice(eTrackType Type)
TRACEF("cXinelibDevice::SetAudioTrackDevice");
LOGDBG("SetAudioTrackDevice(%d)", (int)Type);
+#if 0
if(IS_DOLBY_TRACK(Type))
ForEach(m_clients, &cXinelibThread::AudioStreamChanged,
true, (int)(Type - ttDolbyFirst));
if(IS_AUDIO_TRACK(Type))
- ForEach(m_clients, &cXinelibThread::AudioStreamChanged,
+ ForEach(m_clients, &cXinelibThread::AudioStreamChanged,
false, AUDIO_STREAM + (int)(Type - ttAudioFirst));
+#endif
}
-
+
void cXinelibDevice::SetAudioChannelDevice(int AudioChannel)
{
TRACEF("cXinelibDevice::SetAudioChannelDevice");
@@ -1040,11 +1042,25 @@ void cXinelibDevice::SetAudioChannelDevice(int AudioChannel)
void cXinelibDevice::SetDigitalAudioDevice(bool On)
{
TRACEF("cXinelibDevice::SetDigitalAudioDevice");
-
LOGDBG("SeDigitalAudioDevice(%s)", On ? "on" : "off");
- //
- // should we do something here ???
- //
+
+ eTrackType CurrTrack = GetCurrentAudioTrack();
+ if(m_LastTrack != CurrTrack) {
+ bool ac3 = IS_DOLBY_TRACK(CurrTrack);
+ int index = CurrTrack - (ac3 ? ttDolbyFirst : ttAudioFirst);
+ m_LastTrack = CurrTrack;
+#if 0
+ LOGDBG(" Switching audio track -> %d (%02x:%s:%d)", m_LastTrack,
+ ac3 ? PRIVATE_STREAM1 : (index+AUDIO_STREAM),
+ ac3 ? "AC3" : "MPEG", index);
+#endif
+ if(ac3)
+ ForEach(m_clients, &cXinelibThread::AudioStreamChanged, true,
+ (PRIVATE_STREAM1 << 8) | index);
+ else
+ ForEach(m_clients, &cXinelibThread::AudioStreamChanged, false,
+ (index + AUDIO_STREAM) << 8);
+ }
}
void cXinelibDevice::SetVideoFormat(bool VideoFormat16_9)
diff --git a/device.h b/device.h
index 960bc832..110c1d4b 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h,v 1.2 2006-06-04 11:00:04 phintuka Exp $
+ * $Id: device.h,v 1.3 2006-07-02 17:09:04 phintuka Exp $
*
*/
@@ -61,7 +61,8 @@ class cXinelibDevice : public cDevice
// Audio facilities
private:
- int m_AudioChannel;
+ eTrackType m_LastTrack;
+ int m_AudioChannel;
protected:
virtual int GetAudioChannelDevice(void) {return m_AudioChannel;}
virtual void SetAudioChannelDevice(int AudioChannel);