basesink: fix buffer leaks if preroll failed
authorJason Lin <shangchieh@realtek.com>
Thu, 13 Jul 2017 13:52:34 +0000 (21:52 +0800)
committerMatthew Waters <matthew@centricular.com>
Fri, 14 Jul 2017 06:54:09 +0000 (16:54 +1000)
buffer is not unreferened if preroll failed

:Detailed Notes:
- Problem : video freeze when switching from pause to 1/2-FF repeatedly
- RootCause : buffer leaks in basesink
- Solution : unref the buffer if prerolled failed

:Testing Preformed:
How to Test :
pause -> 1/2 FF -> resume -> pause -> 1/2 FF ...

https://bugzilla.gnome.org/show_bug.cgi?id=784932

libs/gst/base/gstbasesink.c

index ee12a6b..bd78154 100644 (file)
@@ -3656,6 +3656,7 @@ dropped:
 preroll_failed:
   {
     GST_DEBUG_OBJECT (basesink, "preroll failed: %s", gst_flow_get_name (ret));
+    gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
     return ret;
   }
 }