summaryrefslogtreecommitdiff
path: root/ui/qt/rtp_audio_stream.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-11-20 20:08:10 +0100
committerPeter Wu <peter@lekensteyn.nl>2015-11-22 11:25:06 +0000
commit74247f96a998797e933f09f566f60406b9ba92b4 (patch)
treeb77012c9d077d22003861cea1a6766b882dc72aa /ui/qt/rtp_audio_stream.cpp
parent26366ef795739920c858f5b7459476dc56677410 (diff)
downloadwireshark-74247f96a998797e933f09f566f60406b9ba92b4.tar.gz
Fix RTP player crash on invalid streams
On Linux with pulseaudio, the RTP player can crash when an invalid RTP stream is played. Prevent that by detecting when stream playback fails. Since the stateChanged signal receiver is registered on the same thread, it is guaranteed that any outputStateChanged calls happen before returning from audio_output_->start(). GTK+ not have this issue, its player simply does not show the decoded stream at all. Change-Id: I51a91a7f410ef3d46551bc8df0049542efbb806f Reviewed-on: https://code.wireshark.org/review/11997 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/qt/rtp_audio_stream.cpp')
-rw-r--r--ui/qt/rtp_audio_stream.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp
index c16eca903c..44bad62e2e 100644
--- a/ui/qt/rtp_audio_stream.cpp
+++ b/ui/qt/rtp_audio_stream.cpp
@@ -533,6 +533,11 @@ void RtpAudioStream::startPlaying()
tempfile_->seek(0);
audio_output_->start(tempfile_);
emit startedPlaying();
+ // QTBUG-6548 StoppedState is not always emitted on error, force a cleanup
+ // in case playback fails immediately.
+ if (audio_output_ && audio_output_->state() == QAudio::StoppedState) {
+ outputStateChanged();
+ }
}
void RtpAudioStream::stopPlaying()