Remove useless processing for non-raw formats
authorEdward Hervey <bilboed@bilboed.com>
Mon, 26 Jan 2009 09:33:55 +0000 (10:33 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 30 Jan 2009 16:01:30 +0000 (17:01 +0100)
gst/avi/gstavidemux.c

index cf7b0c1..7a3166c 100644 (file)
@@ -3583,16 +3583,11 @@ swap_line (guint8 * d1, guint8 * d2, guint8 * tmp, gint bytes)
   memcpy (d2, tmp, bytes);
 }
 
-/*
- * Helper for gst_avi_demux_insert()
- */
-static gboolean
-gst_avi_demux_is_uncompressed (guint32 fourcc)
-{
-  return fourcc == GST_RIFF_DIB ||
-      fourcc == GST_RIFF_rgb ||
-      fourcc == GST_RIFF_RGB || fourcc == GST_RIFF_RAW;
-}
+
+#define gst_avi_demux_is_uncompressed(fourcc)          \
+  (fourcc == GST_RIFF_DIB ||                           \
+   fourcc == GST_RIFF_rgb ||                           \
+   fourcc == GST_RIFF_RGB || fourcc == GST_RIFF_RAW)
 
 /*
  * Invert DIB buffers... Takes existing buffer and
@@ -3608,6 +3603,9 @@ gst_avi_demux_invert (avi_stream_context * stream, GstBuffer * buf)
   gint bpp, stride;
   guint8 *tmp = NULL;
 
+  if (stream->strh->type != GST_RIFF_FCC_vids)
+    return buf;
+
   if (!gst_avi_demux_is_uncompressed (stream->strh->fcc_handler)) {
     return buf;                 /* Ignore non DIB buffers */
   }