File mozilla-gstreamer.patch of Package MozillaFirefox.884

# HG changeset patch
# Parent a9a49c20c491011f981b6c110aadfa6a01a1431e
# User Wolfgang Rosenauer <wr@rosenauer.org>
Bug 761030 - Crash with HTML 5 video with gstreamer enabled (TM: 16)

No Bug - use GStreamer _only_ for MP4 (not WebM/OGG)

diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -2278,21 +2278,17 @@ nsHTMLMediaElement::CreateDecoder(const 
     nsRefPtr<nsRawDecoder> decoder = new nsRawDecoder();
     if (decoder->Init(this)) {
       return decoder.forget();
     }
   }
 #endif
 #ifdef MOZ_OGG
   if (IsOggType(aType)) {
-#ifdef MOZ_GSTREAMER 
-    nsRefPtr<nsGStreamerDecoder> decoder = new nsGStreamerDecoder();
-#else
     nsRefPtr<nsOggDecoder> decoder = new nsOggDecoder();
-#endif
     if (decoder->Init(this)) {
       return decoder.forget();
     }
   }
 #endif
 #ifdef MOZ_WAVE
   if (IsWaveType(aType)) {
     nsRefPtr<nsWaveDecoder> decoder = new nsWaveDecoder();
@@ -2306,21 +2302,17 @@ nsHTMLMediaElement::CreateDecoder(const 
     nsRefPtr<nsMediaPluginDecoder> decoder = new nsMediaPluginDecoder(aType);
     if (decoder->Init(this)) {
       return decoder.forget();
     }
   }
 #endif
 #ifdef MOZ_WEBM
   if (IsWebMType(aType)) {
-#ifdef MOZ_GSTREAMER 
-    nsRefPtr<nsGStreamerDecoder> decoder = new nsGStreamerDecoder();
-#else
     nsRefPtr<nsWebMDecoder> decoder = new nsWebMDecoder();
-#endif
     if (decoder->Init(this)) {
       return decoder.forget();
     }
   }
 #endif
 
 #ifdef MOZ_GSTREAMER 
   if (IsH264Type(aType)) {
diff --git a/content/media/gstreamer/nsGStreamerReader.cpp b/content/media/gstreamer/nsGStreamerReader.cpp
--- a/content/media/gstreamer/nsGStreamerReader.cpp
+++ b/content/media/gstreamer/nsGStreamerReader.cpp
@@ -447,16 +447,18 @@ bool nsGStreamerReader::DecodeVideoFrame
   for(int i = 0; i < 3; i++) {
     b.mPlanes[i].mData = data + gst_video_format_get_component_offset(format, i,
         width, height);
     b.mPlanes[i].mStride = gst_video_format_get_row_stride(format, i, width);
     b.mPlanes[i].mHeight = gst_video_format_get_component_height(format,
         i, height);
     b.mPlanes[i].mWidth = gst_video_format_get_component_width(format,
         i, width);
+    b.mPlanes[i].mOffset = 0;
+    b.mPlanes[i].mSkip = 0;
   }
 
   bool isKeyframe = !GST_BUFFER_FLAG_IS_SET(buffer,
       GST_BUFFER_FLAG_DELTA_UNIT);
   /* XXX ? */
   PRInt64 offset = 0;
   VideoData *video = VideoData::Create(mInfo,
                                        mDecoder->GetImageContainer(),
openSUSE Build Service is sponsored by