Skip to content

Commit

Permalink
Fix possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviotordini committed Oct 8, 2020
1 parent 8f7c0b4 commit 98ab60a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mediaview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ void MediaView::mediaStateChanged(Media::State state) {
if (pauseTime > 0 && (state == Media::PlayingState || state == Media::BufferingState)) {
qDebug() << "Seeking to" << pauseTime;
media->seek(pauseTime);
media->play();
pauseTime = 0;
}
if (state == Media::PlayingState) {
Expand Down Expand Up @@ -444,9 +445,12 @@ void MediaView::pause() {
default:
if (pauseTimer.hasExpired(60000)) {
pauseTimer.invalidate();
connect(playlistModel->activeVideo(), &Video::gotStreamUrl, this,
&MediaView::resumeWithNewStreamUrl);
playlistModel->activeVideo()->loadStreamUrl();
auto activeVideo = playlistModel->activeVideo();
if (activeVideo) {
connect(activeVideo, &Video::gotStreamUrl, this,
&MediaView::resumeWithNewStreamUrl);
activeVideo->loadStreamUrl();
}
} else
media->play();
break;
Expand Down

0 comments on commit 98ab60a

Please sign in to comment.