ffmpegcolorspace: chwck formats just once per _chain()
authorStefan Kost <ensonic@users.sf.net>
Thu, 8 Oct 2009 15:08:22 +0000 (18:08 +0300)
committerStefan Kost <ensonic@users.sf.net>
Thu, 8 Oct 2009 15:10:08 +0000 (18:10 +0300)
gst/ffmpegcolorspace/gstffmpegcolorspace.c
gst/ffmpegcolorspace/imgconvert.c

index f4f1ae8..7045f29 100644 (file)
@@ -439,7 +439,9 @@ gst_ffmpegcsp_transform (GstBaseTransform * btrans, GstBuffer * inbuf,
   space = GST_FFMPEGCSP (btrans);
 
   GST_DEBUG ("from %d -> to %d", space->from_pixfmt, space->to_pixfmt);
-  if (space->from_pixfmt == PIX_FMT_NB || space->to_pixfmt == PIX_FMT_NB)
+
+  if (G_UNLIKELY (space->from_pixfmt == PIX_FMT_NB ||
+          space->to_pixfmt == PIX_FMT_NB))
     goto unknown_format;
 
   /* fill from with source data */
index 9af38f3..2e39155 100644 (file)
@@ -2963,9 +2963,6 @@ img_convert (AVPicture * dst, int dst_pix_fmt,
   ConvertEntry *ce;
   AVPicture tmp1, *tmp = &tmp1;
 
-  if (G_UNLIKELY (src_pix_fmt < 0 || src_pix_fmt >= PIX_FMT_NB ||
-          dst_pix_fmt < 0 || dst_pix_fmt >= PIX_FMT_NB))
-    return -1;
   if (G_UNLIKELY (src_width <= 0 || src_height <= 0))
     return 0;