Skip to content

Commit 549b17f

Browse files
committed
MythPlayer: fix possible leak.
If SetAudioOutput was called when an audio object had already been created; the existing object wouldn't have been destroyed
1 parent ee9343e commit 549b17f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mythtv/libs/libmythtv/audioplayer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ QString AudioPlayer::ReinitAudio(void)
101101
}
102102
m_no_audio_out = true;
103103
}
104-
else if (m_no_audio_out)
104+
else if (m_no_audio_out && m_audioOutput)
105105
{
106106
VERBOSE(VB_IMPORTANT, LOC + "Enabling Audio");
107107
m_no_audio_out = false;
@@ -149,6 +149,8 @@ void AudioPlayer::PauseAudioUntilBuffered()
149149

150150
void AudioPlayer::SetAudioOutput(AudioOutput *ao)
151151
{
152+
// delete current audio class if any
153+
DeleteOutput();
152154
m_lock.lock();
153155
m_audioOutput = ao;
154156
m_lock.unlock();

0 commit comments

Comments
 (0)