startTS = 0;
endTS = 0;
- startup = true;
videoStartup = false;
+ preBuffering = false;
isRecording = tIsRecording;
isRadio = tIsRadio;
// Standard play start
logger->log("Player", Log::DEBUG, "Standard play start");
+ startup = true;
+
audio->reset();
video->reset();
demuxer.reset();
+ if (!isRadio) demuxer.seek();
// ------------------------ This one works, but doesn't allow any pre-buffering.
+/*
videoStartup = true;
threadStart();
afeed.start();
audio->sync();
audio->play();
video->pause();
-
+*/
// ------------------------ This one doesn't work, but it should, and would allow for prebuffering.
+ videoStartup = true;
+ threadStart();
+
+ if (isRecording)
+ {
+ logger->log("Player", Log::DEBUG, "Immediate play");
+ afeed.start();
+ video->sync();
+ audio->sync();
+ audio->play();
+ video->pause();
+ }
+ else // do prebuffering
+ {
+ logger->log("Player", Log::DEBUG, "Prebuffering...");
+ preBuffering = true;
+ }
// ------------------------------------------------------------------------------------------------
UINT thisRead;
UINT writeLength;
UINT thisWrite;
+ UINT preBufferTotal;
VDR* vdr = VDR::getInstance();
startup = false;
}
+ if (preBuffering)
+ {
+ preBufferTotal += thisRead;
+ if (preBufferTotal > 500000)
+ {
+ logger->log("Player", Log::DEBUG, "Got >500K, prebuffering complete");
+
+ preBuffering = false;
+ preBufferTotal = 0;
+
+ afeed.start();
+ video->sync();
+ audio->sync();
+ audio->play();
+ video->pause();
+ }
+ }
+
if (feedMode == MODE_NORMAL)
{
feedPosition += thisRead;
void Player::threadPostStopCleanup()
{
- logger->log("Player", Log::DEBUG, "Post stop cleanup 1");
if (threadBuffer)
{
- logger->log("Player", Log::DEBUG, "Post stop cleanup 2");
free(threadBuffer);
threadBuffer = NULL;
}
- logger->log("Player", Log::DEBUG, "Post stop cleanup 3");
}
void Player::setStartTS(UINT dataInBuffer)