[Bug 664133] [0.11] adapter: automatically unmap on clearing

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Nov 15 09:47:30 PST 2011


https://bugzilla.gnome.org/show_bug.cgi?id=664133
  GStreamer | gstreamer (core) | unspecified

--- Comment #1 from Vincent Penquerc'h <vincent.penquerch at collabora.co.uk> 2011-11-15 17:47:25 UTC ---
Created an attachment (id=201468)
 View: https://bugzilla.gnome.org/attachment.cgi?id=201468
 Review: https://bugzilla.gnome.org/review?bug=664133&attachment=201468

adapter: automatically unmap on clearing

When _clear gets called between _map and _unmap, buffers
will be unreffed. If the adapter was mapped, memory leaks
may occur.
While calling _clear between _map and _unmap does not seem
like such a great idea, this is possible in the audio
encoder base class, as _clear may be called in _finish_frame.
Since the audio encoder relies on flushing to keep track of
timestamps, delaying flushing till after handle_frame seems
dangerous.
So, we unmap on clear, as the next unmap will do nothing.
This makes _clear safe to call between _map and _unmap,
while avoiding leaking the mapped buffer.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list