gstvpxdec: Call vpx_img_free() after log message
[platform/upstream/gst-plugins-good.git] / ext / vpx / gstvpxdec.c
index 2501c4a..39cdd3b 100644 (file)
@@ -62,6 +62,20 @@ gst_vpx_dec_post_processing_flags_get_type (void)
     {C_FLAGS (VP8_DEBLOCK), "Deblock", "deblock"},
     {C_FLAGS (VP8_DEMACROBLOCK), "Demacroblock", "demacroblock"},
     {C_FLAGS (VP8_ADDNOISE), "Add noise", "addnoise"},
+#ifndef HAVE_VPX_1_8
+    {C_FLAGS (VP8_DEBUG_TXT_FRAME_INFO),
+          "Print frame information",
+        "visualize-frame-info"},
+    {C_FLAGS (VP8_DEBUG_TXT_MBLK_MODES),
+          "Show macroblock mode selection overlaid on image",
+        "visualize-macroblock-modes"},
+    {C_FLAGS (VP8_DEBUG_TXT_DC_DIFF),
+          "Show dc diff for each macro block overlaid on image",
+        "visualize-dc-diff"},
+    {C_FLAGS (VP8_DEBUG_TXT_RATE_INFO),
+          "Print video rate info",
+        "visualize-rate-info"},
+#endif
     {C_FLAGS (VP8_MFQE), "Multi-frame quality enhancement", "mfqe"},
     {0, NULL, NULL}
   };
@@ -491,6 +505,7 @@ gst_vpx_dec_release_buffer_cb (gpointer priv, vpx_codec_frame_buffer_t * fb)
   gst_buffer_unmap (frame->buffer, &frame->info);
   gst_buffer_unref (frame->buffer);
   g_free (frame);
+  fb->priv = NULL;
 
   return 0;
 }
@@ -688,10 +703,15 @@ gst_vpx_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
   img = vpx_codec_get_frame (&dec->decoder, &iter);
   if (img) {
     if (vpxclass->get_frame_format (dec, img, &fmt) == FALSE) {
+#ifndef __TIZEN__
       vpx_img_free (img);
+#endif
       GST_ELEMENT_ERROR (decoder, LIBRARY, ENCODE,
           ("Failed to decode frame"), ("Unsupported color format %d",
               img->fmt));
+#ifdef __TIZEN__
+      vpx_img_free (img);
+#endif
       gst_video_codec_frame_unref (frame);
       return GST_FLOW_ERROR;
     }