avidemux: support raw video with negative height
authorDirk Van Haerenborgh <vhdirk@gmail.com>
Sun, 10 Mar 2013 08:25:34 +0000 (09:25 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 11 Mar 2013 13:23:46 +0000 (14:23 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=695541

gst/avi/gstavidemux.c

index 49364eb3137e44b0f78eb2f45558dfcaddb582b2..8bc0107e0d8d0562043612d1d712fc7ec586ff3b 100644 (file)
@@ -4544,6 +4544,10 @@ gst_avi_demux_invert (GstAviStream * stream, GstBuffer * buf)
     return buf;                 /* Ignore non DIB buffers */
   }
 
+  /* raw rgb data is stored topdown, but instead of inverting the buffer, */
+  /* some tools just negate the height field in the header (e.g. ffmpeg) */
+  if (((gint32) stream->strf.vids->height) < 0)
+    return buf;
 
   h = stream->strf.vids->height;
   w = stream->strf.vids->width;