From bee1e6eeac1faf99aafaf1f4d3e63f9e2a9c1a54 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 29 Apr 2006 14:21:21 +0000 Subject: [PATCH] Changes... --- player.cc | 23 +++++++++++++++-------- player.h | 8 +++++--- vvideolive.cc | 4 ++-- vvideorec.cc | 2 +- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/player.cc b/player.cc index 694745e..5c022cf 100644 --- a/player.cc +++ b/player.cc @@ -20,7 +20,7 @@ #include "player.h" -Player::Player(MessageQueue* messageQueue, UCHAR tIsRecording, UCHAR isRadio) +Player::Player(MessageQueue* messageQueue, bool tIsRecording, bool tIsRadio) : vfeed(this), afeed(this) { commandMessageQueue = messageQueue; @@ -35,25 +35,28 @@ Player::Player(MessageQueue* messageQueue, UCHAR tIsRecording, UCHAR isRadio) streamLength = 0; feedPosition = 0; feedMode = MODE_NORMAL; - videoStartup = false; - isRecording = tIsRecording; lastRescan = 0; startTS = 0; endTS = 0; - startup = 1; + + startup = true; + videoStartup = false; + isRecording = tIsRecording; + isRadio = tIsRadio; + threadBuffer = NULL; if (isRadio) { blockSize = 20000; startupBlockSize = 60000; - video->turnVideoOff(); + video->turnVideoOff(); } else { blockSize = 100000; startupBlockSize = 250000; - video->turnVideoOn(); + video->turnVideoOn(); } } @@ -275,6 +278,7 @@ void Player::restartAt(ULLONG timecode) video->reset(); audio->reset(); demuxer.flush(); + if (!isRadio) demuxer.seek(); feedPosition = newPosition; videoStartup = true; afeed.start(); @@ -327,6 +331,7 @@ void Player::toggleFastForward() video->reset(); audio->reset(); demuxer.flush(); + if (!isRadio) demuxer.seek(); videoStartup = true; afeed.enable(); @@ -377,6 +382,8 @@ void Player::toggleFastBackward() video->reset(); video->play(); demuxer.flush(); + if (!isRadio) demuxer.seek(); + threadStart(); } } @@ -523,7 +530,7 @@ void Player::threadMethod() if (isRecording) setEndTS(); - startup = 0; + startup = false; } if (feedMode == MODE_NORMAL) @@ -535,7 +542,7 @@ void Player::threadMethod() if (feedPosition >= blockSize) { feedPosition -= blockSize; - demuxer.seek(); + if (!isRadio) demuxer.seek(); } else { diff --git a/player.h b/player.h index 0fef7a1..d48bc12 100644 --- a/player.h +++ b/player.h @@ -43,7 +43,7 @@ class Player : public Thread_TYPE, public Callback { public: - Player(MessageQueue* messageQueue, UCHAR isRecording, UCHAR isRadio); + Player(MessageQueue* messageQueue, bool isRecording, bool isRadio); virtual ~Player(); int init(); @@ -89,17 +89,19 @@ class Player : public Thread_TYPE, public Callback Audio* audio; Video* video; Demuxer demuxer; - int startup; VFeed vfeed; AFeed afeed; + + bool startup; bool videoStartup; + bool isRecording; + bool isRadio; ULLONG startTS; ULLONG endTS; ULLONG streamLength; ULLONG feedPosition; UCHAR feedMode; - UCHAR isRecording; time_t lastRescan; UINT blockSize; UINT startupBlockSize; diff --git a/vvideolive.cc b/vvideolive.cc index 5281013..63e2233 100644 --- a/vvideolive.cc +++ b/vvideolive.cc @@ -38,8 +38,8 @@ VVideoLive::VVideoLive(ChannelList* tchanList, ULONG tstreamType, VChannelList* unavailableView = NULL; streamType = tstreamType; videoMode = video->getMode(); - if (streamType == VDR::RADIO) player = new Player(Command::getInstance(), 0, 1); - else player = new Player(Command::getInstance(), 0, 0); + if (streamType == VDR::RADIO) player = new Player(Command::getInstance(), false, true); + else player = new Player(Command::getInstance(), false, false); player->init(); create(video->getScreenWidth(), video->getScreenHeight()); diff --git a/vvideorec.cc b/vvideorec.cc index 01f953e..1c55828 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -26,7 +26,7 @@ VVideoRec::VVideoRec(Recording* rec) video = Video::getInstance(); timers = Timers::getInstance(); - player = new Player(Command::getInstance(), 1, 0); // say 0 for radio because buffering will work anyway + player = new Player(Command::getInstance(), true, false); // say 0 for radio because buffering will work anyway player->init(); videoMode = video->getMode(); -- 2.39.2