summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device.c21
-rw-r--r--device.h8
2 files changed, 20 insertions, 9 deletions
diff --git a/device.c b/device.c
index 170b2bfa..2e86f1ee 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.91 2010-02-01 12:20:01 phintuka Exp $
+ * $Id: device.c,v 1.92 2010-02-03 00:13:10 phintuka Exp $
*
*/
@@ -214,6 +214,7 @@ cXinelibDevice::cXinelibDevice()
m_h264 = false;
m_VideoSize = (video_size_t*)calloc(1, sizeof(video_size_t));
+ m_tssVideoSize = NULL;
TsBufferClear();
}
@@ -227,6 +228,7 @@ cXinelibDevice::~cXinelibDevice()
m_pInstance = NULL;
free (m_VideoSize);
+ ts_state_dispose(m_tssVideoSize);
}
bool cXinelibDevice::StartDevice()
@@ -1189,12 +1191,19 @@ int cXinelibDevice::PlayTsVideo(const uchar *Data, int Length)
if (!AcceptVideoPacket(Data, Length))
return Length;
- if (m_StreamStart) {
- //if (ts_get_video_size(Data, Length, m_VideoSize, m_h264 ? 1:0)) {
+ if (m_StreamStart /*&& TS_PID(Data) == m_PatPmtParser.VPid()*/) {
+ if (!m_tssVideoSize)
+ m_tssVideoSize = ts_state_init(4096);
+
+ if (ts_get_video_size(m_tssVideoSize, Data, m_VideoSize, m_h264 ? 1:0)) {
+
m_StreamStart = false;
- //LOGDBG("Detected video size %dx%d", m_VideoSize->width, m_VideoSize->height);
- //ForEach(m_clients, &cXinelibThread::SetHDMode, (m_VideoSize->width > 800));
- //}
+ LOGMSG("Detected video size %dx%d", m_VideoSize->width, m_VideoSize->height);
+ ForEach(m_clients, &cXinelibThread::SetHDMode, (m_VideoSize->width > 800));
+
+ ts_state_dispose(m_tssVideoSize);
+ m_tssVideoSize = NULL;
+ }
}
return PlayTsAny(Data, Length);
diff --git a/device.h b/device.h
index 3c613c14..702d620a 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.50 2010-02-01 12:20:01 phintuka Exp $
+ * $Id: device.h,v 1.51 2010-02-03 00:13:10 phintuka Exp $
*
*/
@@ -21,6 +21,7 @@ class cChannel;
class cFunctor;
struct video_size_s;
+struct ts_state_s;
typedef enum {
miTitle = 0,
@@ -32,8 +33,8 @@ typedef enum {
mi_Count = 6
} eMetainfoType;
-# define ttXSubtitleNone (-2)
-# define ttXSubtitleAuto (-1)
+#define ttXSubtitleNone (-2)
+#define ttXSubtitleAuto (-1)
#define MAX_METAINFO_LEN 63
@@ -116,6 +117,7 @@ class cXinelibDevice : public cDevice
virtual eVideoSystem GetVideoSystem(void);
struct video_size_s *m_VideoSize;
+ struct ts_state_s *m_tssVideoSize;
#if VDRVERSNUM >= 10708
virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect);
#endif