summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device.c22
-rw-r--r--device.h5
2 files changed, 19 insertions, 8 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:
;
diff --git a/device.h b/device.h
index 41391eb1..c6c18657 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.34 2008-04-14 19:58:50 phintuka Exp $
+ * $Id: device.h,v 1.35 2008-06-11 23:21:49 phintuka Exp $
*
*/
@@ -266,10 +266,9 @@ class cXinelibDevice : public cDevice
virtual int PlayVideo(const uchar *Data, int Length);
virtual int PlayAudio(const uchar *Data, int Length, uchar Id);
+ virtual int PlaySubtitle(const uchar *Data, int Length);
#if VDRVERSNUM < 10510
- virtual int PlaySpu(const uchar *Data, int Length, uchar Id);
-
// conflicts with vdr-1.5.10+ DVB subtitle handling
// override cDevice to get DVD SPUs
virtual int PlayPesPacket(const uchar *Data, int Length,