ffdeinterlace: some minor clean-ups
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 18 Jul 2010 19:15:32 +0000 (20:15 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 18 Jul 2010 19:15:32 +0000 (20:15 +0100)
Don't use studlyCaps; gboolean != GstFlowReturn; use gst_caps_set_simple()
instead of creating a GValue just to set a boolean field on a caps structure.

See #622736.

ext/ffmpeg/gstffmpegdeinterlace.c

index 119d2f53d574ad4945e4bc2fc6f6e002dbfd061d..b140ccfebda9d8b3afae1c7aaff6ecc017ffbeaa 100644 (file)
@@ -112,9 +112,8 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
       GST_FFMPEGDEINTERLACE (gst_pad_get_parent (pad));
   GstStructure *structure = gst_caps_get_structure (caps, 0);
   AVCodecContext *ctx;
-  GValue interlaced = { 0 };
-  GstCaps *srcCaps;
-  GstFlowReturn ret;
+  GstCaps *src_caps;
+  gboolean ret;
 
   if (!gst_structure_get_int (structure, "width", &deinterlace->width))
     return FALSE;
@@ -139,14 +138,11 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
       avpicture_get_size (deinterlace->pixfmt, deinterlace->width,
       deinterlace->height);
 
-  srcCaps = gst_caps_copy (caps);
-  g_value_init (&interlaced, G_TYPE_BOOLEAN);
-  g_value_set_boolean (&interlaced, FALSE);
-  gst_caps_set_value (srcCaps, "interlaced", &interlaced);
-  g_value_unset (&interlaced);
+  src_caps = gst_caps_copy (caps);
+  gst_caps_set_simple (src_caps, "interlaced", G_TYPE_BOOLEAN, FALSE, NULL);
+  ret = gst_pad_set_caps (deinterlace->srcpad, src_caps);
+  gst_caps_unref (src_caps);
 
-  ret = gst_pad_set_caps (deinterlace->srcpad, srcCaps);
-  gst_caps_unref (srcCaps);
   return ret;
 }