Skip to content

Commit

Permalink
MythMusic: Stop playing if a CD is ejected and we were playing a trac…
Browse files Browse the repository at this point in the history
…k from it

Refs #11708.
  • Loading branch information
Paul Harrison committed Aug 11, 2013
1 parent ceb3182 commit 3823b0e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mythplugins/mythmusic/mythmusic/main.cpp
Expand Up @@ -465,6 +465,14 @@ static void handleCDMedia(MythMediaDevice *cd)
{
LOG(VB_MEDIA, LOG_INFO, "Device is not usable clearing cd data");

if (gPlayer->isPlaying() && gPlayer->getCurrentMetadata()
&& gPlayer->getCurrentMetadata()->isCDTrack())
{
// we was playing a cd track which is no longer available so stop playback
// TODO should check the playing track is from the ejected drive if more than one is available
gPlayer->stop(true);
}

// device is not usable so remove any existing CD tracks
if (gMusicData->all_music)
{
Expand Down

0 comments on commit 3823b0e

Please sign in to comment.