mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
androidcamera: Fix memleak and lose of buffer if the data queue is flushing
This commit is contained in:
parent
122083eadb
commit
0552bb1b2a
1 changed files with 4 additions and 1 deletions
|
@ -571,7 +571,10 @@ gst_ahc_src_on_preview_frame (jbyteArray array, gpointer user_data)
|
|||
item->visible = TRUE;
|
||||
item->destroy = (GDestroyNotify) _data_queue_item_free;
|
||||
|
||||
gst_data_queue_push (self->queue, item);
|
||||
if (!gst_data_queue_push (self->queue, item)) {
|
||||
/* Can't add buffer to queue. Must be flushing. */
|
||||
_data_queue_item_free (item);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue