vaapipostproc: minor clean-ups.

Use g_clear_object() wherever appropriate and remove dead-code.
This commit is contained in:
Gwenole Beauchesne 2013-04-17 10:58:04 +02:00
parent 6b259abc02
commit a0e587667a

View file

@ -232,10 +232,7 @@ gst_vaapipostproc_start(GstVaapiPostproc *postproc)
static gboolean
gst_vaapipostproc_stop(GstVaapiPostproc *postproc)
{
if (postproc->display) {
g_object_unref(postproc->display);
postproc->display = NULL;
}
g_clear_object(&postproc->display);
return TRUE;
}
@ -246,7 +243,7 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
GstVaapiSurfaceProxy *proxy;
GstClockTime timestamp;
GstFlowReturn ret;
GstBuffer *outbuf = NULL;
GstBuffer *outbuf;
guint outbuf_flags, flags;
gboolean tff;
@ -254,8 +251,6 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
if (!meta)
goto error_invalid_buffer;
flags = gst_vaapi_video_meta_get_render_flags(meta);
/* Deinterlacing disabled, push frame */
if (!postproc->deinterlace) {
outbuf = gst_buffer_ref(buf);
@ -272,8 +267,9 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
proxy = gst_vaapi_video_meta_get_surface_proxy(meta);
tff = GST_BUFFER_FLAG_IS_SET(buf, GST_VIDEO_BUFFER_FLAG_TFF);
flags &= ~(GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD|
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD);
flags = gst_vaapi_video_meta_get_render_flags(meta) &
~(GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD|
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD);
/* First field */
outbuf = gst_vaapi_video_buffer_new_with_surface_proxy(proxy);