Skip to content

Commit

Permalink
Fix crash on repeat when no media loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
sagiadinos committed Dec 21, 2022
1 parent 00bdc2c commit 3ede930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/player-c2qml/region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ void TRegion::clickSlot()
void TRegion::startShowMedia(BaseMedia *media)
{
// check if this is media is already player now and if yes restart only
if (findMediaById(media->getID()) != Q_NULLPTR)
PlayerBaseMedia *MyTmpMedia = findMediaById(media->getID());
if (MyTmpMedia != Q_NULLPTR)
{
MyMedia = MyTmpMedia;
MyMedia->restart();
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/player-widget/region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ void TRegion::paintEvent(QPaintEvent *)
void TRegion::startShowMedia(BaseMedia *media)
{
// check if this is media is already player now and if yes restart only
if (findMediaById(media->getID()) != Q_NULLPTR)
{
PlayerBaseMedia *MyTmpMedia = findMediaById(media->getID());
if (MyTmpMedia != Q_NULLPTR)
{
MyMedia = MyTmpMedia;
MyMedia->restart();
return;
}
Expand Down

0 comments on commit 3ede930

Please sign in to comment.