summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'device.c')
-rw-r--r--device.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/device.c b/device.c
index 52d9f105..4510dbf9 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.59 2008-05-19 06:54:57 phintuka Exp $
+ * $Id: device.c,v 1.60 2008-06-11 23:21:49 phintuka Exp $
*
*/
@@ -1255,7 +1255,7 @@ int cXinelibDevice::PlayAudio(const uchar *buf, int length, uchar Id)
}
#if VDRVERSNUM < 10510
-int cXinelibDevice::PlaySpu(const uchar *buf, int length, uchar Id)
+int cXinelibDevice::PlaySubtitle(const uchar *buf, int length)
{
TRACEF("cXinelibDevice::PlaySpu");
@@ -1264,21 +1264,33 @@ int cXinelibDevice::PlaySpu(const uchar *buf, int length, uchar Id)
if(((unsigned char *)buf)[3] == PRIVATE_STREAM1) {
+ int PayloadOffset = buf[8] + 9;
+ uchar SubStreamId = buf[PayloadOffset];
+ //uchar SubStreamType = SubStreamId & 0xF0;
+ uchar SubStreamIndex = SubStreamId & 0x1F;
+
if(!m_spuPresent) {
TRACE("cXinelibDevice::PlaySpu first DVD SPU frame");
Skins.QueueMessage(mtInfo,"DVD Subtitles");
m_spuPresent = true;
- ForEach(m_clients, &cXinelibThread::SpuStreamChanged, (int)Id);
+ ForEach(m_clients, &cXinelibThread::SpuStreamChanged, (int)SubStreamIndex);
}
// Strip all but selected SPU track
- if(Id != m_CurrentDvdSpuTrack)
+ if(SubStreamIndex != m_CurrentDvdSpuTrack)
return length;
}
return PlayAny(buf, length);
}
+#else
+int cXinelibDevice::PlaySubtitle(const uchar *Data, int Length)
+{
+ if(!xc.dvb_subtitles)
+ return cDevice::PlaySubtitle(Data, Length);
+ return PlayAny(Data, Length);
+}
#endif
bool cXinelibDevice::Poll(cPoller &Poller, int TimeoutMs)
@@ -1506,7 +1518,7 @@ int cXinelibDevice::PlayPesPacket(const uchar *Data, int Length,
case 0x20: // SPU
case 0x30: // SPU
SetAvailableDvdSpuTrack(SubStreamIndex);
- return PlaySpu(Data, Length, SubStreamIndex);
+ return PlaySubtitle(Data, Length);
break;
default:
;