VideoSource *vs = history.takeLast();
if (!vs->parent()) {
qDebug() << "Deleting VideoSource" << vs->getName() << vs;
+ vs->abort();
vs->deleteLater();
}
}
void MediaView::pause() {
switch (media->state()) {
case Media::PlayingState:
+ qDebug() << "Pausing";
media->pause();
pauseTimer.start();
break;
default:
- if (pauseTimer.hasExpired(60000)) {
+ if (pauseTimer.isValid() && pauseTimer.hasExpired(60000)) {
+ qDebug() << "Pause timer expired";
pauseTimer.invalidate();
auto activeVideo = playlistModel->activeVideo();
if (activeVideo) {
connect(activeVideo, &Video::gotStreamUrl, this,
&MediaView::resumeWithNewStreamUrl);
activeVideo->loadStreamUrl();
- }
- } else
+ } else
+ qDebug() << "No active video";
+ } else {
+ qDebug() << "Playing" << media->file();
media->play();
+ }
break;
}
}
VideoSource *videoSource = history.takeFirst();
// Don't delete videoSource in the Browse view
if (!videoSource->parent()) {
+ videoSource->abort();
videoSource->deleteLater();
}
}