if (!initted) return 0;
initted = 0;
- logger->log("Player", Log::DEBUG, "Player shutdown...");
-
- // copy of stop
+ // copy of stop
if (playing)
{
playing = false;
video->blank();
audio->stop();
vfeed.stop();
+
afeed.stop();
video->reset();
demuxer.reset();
feedPosition = 0;
}
- logger->log("Player", Log::DEBUG, "Player shutdown done");
return 1;
}
-void Player::resyncAudio()
-{
- // Temp hopefully
- if (!initted) return;
- audio->pause();
- MILLISLEEP(500);
- audio->unPause();
-}
-
-void Player::resyncVideo()
-{
- // Temp hopefully
- if (!initted) return;
- video->pause();
- MILLISLEEP(500);
- video->unPause();
-}
-
int Player::play()
{
if (!initted) return 0;
return 1;
}
+ // If we are still seeking in from the last jump, ignore
+ if (videoStartup) return 1;
+
// If we are fast forwarding, set to normal
if (ffwd)
{
return 1;
}
- // If we are already playing, bail // FIXME - resync?
- if (playing)
- {
- logger->log("Player", Log::DEBUG, "DOING RESYNC");
- resyncVideo();
- return 1;
- }
-
// Standard play start
logger->log("Player", Log::DEBUG, "Standard play start");
demuxer.reset();
if (!isRadio) demuxer.seek();
-// ------------------------ This one works, but doesn't allow any pre-buffering.
-/*
- videoStartup = true;
- threadStart();
- afeed.start();
- video->sync();
- audio->sync();
- audio->play();
- video->pause();
-*/
-
-// ------------------------ This one doesn't work, but it should, and would allow for prebuffering.
-
videoStartup = true;
threadStart();
{
logger->log("Player", Log::DEBUG, "Immediate play");
afeed.start();
+ vfeed.start();
video->sync();
audio->sync();
audio->play();
if (!initted) return;
if (!playing) return;
- logger->log("Player", Log::DEBUG, "Stop called", streamLength);
+ // If we are still seeking in from the last jump, ignore
+ if (videoStartup) return;
if (ffwd || fbwd)
{
void Player::restartAt(ULLONG timecode)
{
+ // If we are still seeking in from the last jump, ignore
+ if (videoStartup) return;
+
if (paused) togglePause();
if (ffwd) toggleFastForward();
feedPosition = newPosition;
videoStartup = true;
afeed.start();
+ vfeed.start();
threadStart();
audio->play();
video->sync();
if (!initted) return;
if (!playing) return;
+ // If we are still seeking in from the last jump, ignore
+ if (videoStartup) return;
+
if (paused) togglePause();
if (fbwd) toggleFastBackward();
videoStartup = true;
afeed.enable();
afeed.start();
+ vfeed.start();
threadStart();
audio->play();
video->sync();
if (!initted) return;
if (!playing) return;
+ // If we are still seeking in from the last jump, ignore
+ if (videoStartup) return;
+
if (paused) togglePause();
if (ffwd) toggleFastForward();
if (videoStartup)
{
videoStartup = false;
- logger->log("Player", Log::DEBUG, "Starting VFeed");
video->reset();
video->play();
video->sync();
- vfeed.start();
+ vfeed.release();
}
threadSignalNoLock();
video->sync();
video->pause();
afeed.start();
+ vfeed.start();
+ // FIXME - see if this can segfault because it is starting threads out of the master mutex
}
}