From dc73644dc715fb8be46e867be6f50db50074bee4 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 30 Sep 2006 19:29:14 +0000 Subject: [PATCH] Radio live prebuffering fix, compile problem with new demuxer stripaudio fixed --- demuxer.cc | 6 +++++- player.cc | 8 +++++--- player.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/demuxer.cc b/demuxer.cc index 3b1c6d9..f03b279 100644 --- a/demuxer.cc +++ b/demuxer.cc @@ -324,7 +324,7 @@ UINT Demuxer::stripAudio(UCHAR* buf, UINT len) while (read_pos + 7 <= len) { pattern = ((pattern & 0xFFFFFF) << 8) | buf[read_pos+3]; - if (pattern < 0x100|PESTYPE_VID0 || pattern > 0x100|PESTYPE_VIDMAX) + if (pattern < (0x100|PESTYPE_VID0) || pattern > (0x100|PESTYPE_VIDMAX)) read_pos++; else { @@ -344,3 +344,7 @@ UINT Demuxer::stripAudio(UCHAR* buf, UINT len) } return write_pos; } + + + + diff --git a/player.cc b/player.cc index b8be860..b426b2a 100644 --- a/player.cc +++ b/player.cc @@ -46,14 +46,16 @@ Player::Player(MessageQueue* messageQueue, bool tIsRecording, bool tIsRadio) if (isRadio) { - blockSize = 20000; - startupBlockSize = 60000; + blockSize = 10000; + startupBlockSize = 20000; + preBufferSize = 20000; video->turnVideoOff(); } else { blockSize = 100000; startupBlockSize = 250000; + preBufferSize = 500000; video->turnVideoOn(); } } @@ -829,7 +831,7 @@ void Player::threadFeedLive() if (preBuffering) { preBufferTotal += thisRead; - if (preBufferTotal > 500000) + if (preBufferTotal >= preBufferSize) { logger->log("Player", Log::DEBUG, "Got >500K, prebuffering complete"); diff --git a/player.h b/player.h index 0920c58..8c02d7f 100644 --- a/player.h +++ b/player.h @@ -130,6 +130,7 @@ class Player : public Thread_TYPE, public Callback ULONG currentFrameNumber; UINT blockSize; UINT startupBlockSize; + UINT preBufferSize; UCHAR* threadBuffer; UCHAR state; UCHAR ifactor; -- 2.39.5