Bug 761786 - fix media playback crash when using omx-plugin and reloading videos - r=edwin
authorChris Double <chris.double@double.co.nz>
Thu, 07 Jun 2012 15:29:08 +1200
changeset 98749 717abd8063e2eb36882e3dd3851788241aeda761
parent 98748 596ebdcb918886af05f0d7e8a2319d5ecc67891e
child 98750 fb17ffb3bf7750108eae2287b9f2cecd64644480
push id1729
push userlsblakk@mozilla.com
push dateMon, 16 Jul 2012 20:02:43 +0000
treeherdermozilla-aurora@f4e75e148951 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs761786
milestone16.0a1
Bug 761786 - fix media playback crash when using omx-plugin and reloading videos - r=edwin
media/omx-plugin/OmxPlugin.cpp
--- a/media/omx-plugin/OmxPlugin.cpp
+++ b/media/omx-plugin/OmxPlugin.cpp
@@ -186,16 +186,24 @@ OmxDecoder::OmxDecoder(PluginHost *aPlug
   mVideoBuffer = NULL;
   mAudioBuffer = NULL;
 }
 
 OmxDecoder::~OmxDecoder()
 {
   ReleaseVideoBuffer();
   ReleaseAudioBuffer();
+
+  if (mVideoSource.get()) {
+    mVideoSource->stop();
+  }
+
+  if (mAudioSource.get()) {
+    mAudioSource->stop();
+  }
 }
 
 class AutoStopMediaSource {
   sp<MediaSource> mMediaSource;
 public:
   AutoStopMediaSource(sp<MediaSource> aMediaSource) : mMediaSource(aMediaSource) {
   }