From eb05bdc66045126d133e203d2c77977c40ff02a7 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Mon, 14 Apr 2008 19:46:37 +0000 Subject: [PATCH] Vista compatibility --- dssourcepin.cc | 5 +++++ event.h | 1 + media.cc | 2 +- threadwin.cc | 13 +++++++++---- threadwin.h | 1 + vchannelselect.cc | 2 +- vepg.cc | 2 +- videowin.cc | 2 +- vvideolivetv.cc | 6 +++--- 9 files changed, 23 insertions(+), 11 deletions(-) diff --git a/dssourcepin.cc b/dssourcepin.cc index ae38bba..cd6049d 100644 --- a/dssourcepin.cc +++ b/dssourcepin.cc @@ -145,6 +145,7 @@ void ReleaseMType(AM_MEDIA_TYPE* free) { DsSourcePin::DsSourcePin(DsSourceFilter *pFilter, HRESULT *phr,LPCWSTR pName,bool audio) { + medtype.pbFormat=NULL; isaudiopin=audio; m_pFilter=pFilter; connected=NULL; @@ -750,6 +751,10 @@ HRESULT DsSourcePin::GetMediaTypeMpegVideo(int iPosition, AM_MEDIA_TYPE *pmt) hdr.hdr.bmiHeader.biSize = sizeof(hdr.hdr.bmiHeader); hdr.hdr.bmiHeader.biWidth = 720; hdr.hdr.bmiHeader.biHeight = 568; + /* Vista compat*/ + hdr.hdr.dwPictAspectRatioX=1; + hdr.hdr.dwPictAspectRatioY=1; + /* Vista compat*/ pmt->cbFormat = sizeof(hdr); pmt->pbFormat = (BYTE*)CoTaskMemAlloc(sizeof(hdr)); memcpy(pmt->pbFormat,&hdr,sizeof(hdr)); diff --git a/event.h b/event.h index c9db9f7..4b8a2f2 100644 --- a/event.h +++ b/event.h @@ -23,6 +23,7 @@ #include #include +#include #include "defines.h" diff --git a/media.cc b/media.cc index 602d84a..3647f50 100644 --- a/media.cc +++ b/media.cc @@ -112,7 +112,7 @@ char * Media::getTimeString(char * buffer) const { #ifndef _MSC_VER strftime(buffer,TIMEBUFLEN, "%0g/%0m/%0d %0H:%0M ", btime); #else - strftime(buffer, TIMEBUFLEN, "%g/%m/%d %H:%M ", btime); + strftime(buffer, TIMEBUFLEN, "%y/%m/%d %H:%M ", btime); #endif } else { diff --git a/threadwin.cc b/threadwin.cc index 994f6dc..9f7471a 100644 --- a/threadwin.cc +++ b/threadwin.cc @@ -20,12 +20,17 @@ #include "threadwin.h" +ThreadWin::ThreadWin() +{ + pthread=threadCond=threadCondMutex=threadKillable=NULL; +} + ThreadWin::~ThreadWin() { - CloseHandle(pthread); - CloseHandle(threadCond); - CloseHandle(threadCondMutex); - CloseHandle(threadKillable); + if (pthread) CloseHandle(pthread); + if (threadCond) CloseHandle(threadCond); + if (threadCondMutex) CloseHandle(threadCondMutex); + if (threadKillable) CloseHandle(threadKillable); } diff --git a/threadwin.h b/threadwin.h index d78350a..4fb48f8 100644 --- a/threadwin.h +++ b/threadwin.h @@ -41,6 +41,7 @@ class ThreadWin : public Thread virtual void threadMethod()=0; virtual void threadPostStopCleanup()=0; + ThreadWin(); ~ThreadWin(); // Methods to use from outside the thread diff --git a/vchannelselect.cc b/vchannelselect.cc index 9cde894..cf821ab 100644 --- a/vchannelselect.cc +++ b/vchannelselect.cc @@ -113,7 +113,7 @@ void VChannelSelect::changeChannel(bool which) for(i = numGot - 1; i >= 0; i--) { - m->parameter += input[i] * (ULONG)pow(10, i); + m->parameter += input[i] * (ULONG)pow(10., i); } if (which) diff --git a/vepg.cc b/vepg.cc index e3215e3..f9e06d1 100644 --- a/vepg.cc +++ b/vepg.cc @@ -536,7 +536,7 @@ void VEpg::drawgrid() // redraws grid and select programme t = ltime; struct tm* tms; tms = localtime(&t); - strftime(timeString, 19, "%a %e %b", tms); + strftime(timeString, 19, "%a %d %b", tms); int timey = chanListbox.getRootBoxOffsetY() - Surface::getFontHeight() - 3; int timex = 135; drawTextRJ(timeString, timex - 10, timey, Colour::LIGHTTEXT); // print date diff --git a/videowin.cc b/videowin.cc index a831d38..c3f8fe3 100644 --- a/videowin.cc +++ b/videowin.cc @@ -800,7 +800,7 @@ int VideoWin::dsInitVideoFilter() return 1; } #endif - + return 1; } int VideoWin::setAudioStreamType(UCHAR type) diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 1aa120c..b25a543 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -418,7 +418,7 @@ void VVideoLiveTV::doOK() if (keying) { UINT newChannel = 0; - for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10, i); + for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10., i); channelChange(NUMBER, newChannel); osdChannelIndex = currentChannelIndex; @@ -487,7 +487,7 @@ void VVideoLiveTV::doKey(int command) if (keying == numberWidth) { UINT newChannel = 0; - for(i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10, i); + for(i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10., i); channelChange(NUMBER, newChannel); osdChannelIndex = currentChannelIndex; @@ -657,7 +657,7 @@ void VVideoLiveTV::timercall(int ref) // Really, now that cancelTimer basically protects us from deletion, why can't we execute gui stuff here? UINT newChannel = 0; - for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10, i); + for(int i = keying - 1; i >= 0; i--) newChannel += keyingInput[i] * (ULONG)pow(10., i); Message* m = new Message(); m->message = Message::CHANNEL_CHANGE; -- 2.39.5