diff options
author | Matthew Waters <ystreet00@gmail.com> | 2013-11-13 15:57:07 +1100 |
---|---|---|
committer | Matthew Waters <ystreet00@gmail.com> | 2014-03-15 18:37:04 +0100 |
commit | afdde267ef359876854cf29ecf5469e5ff888877 (patch) | |
tree | 5b99d2acec4c5e991cbdc69a8d6ed11c294bd0f9 | |
parent | 5cb409218ac8f940078c82a8b5306e06760bfc37 (diff) |
[847/906] mixer: unmap the video frames we map
plugs a memory leak
-rw-r--r-- | gst-libs/gst/gl/gstglmixer.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gst-libs/gst/gl/gstglmixer.c b/gst-libs/gst/gl/gstglmixer.c index d02ee76c9..e5251e47b 100644 --- a/gst-libs/gst/gl/gstglmixer.c +++ b/gst-libs/gst/gl/gstglmixer.c @@ -1433,6 +1433,7 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) guint out_tex; guint array_index = 0; guint i; + gboolean res; GST_TRACE ("Processing buffers"); @@ -1457,7 +1458,8 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) GST_VIDEO_FRAME_HEIGHT (&out_frame))) { GST_ELEMENT_ERROR (mix, RESOURCE, NOT_FOUND, ("%s", "Failed to init upload format"), (NULL)); - return FALSE; + res = FALSE; + goto out; } } @@ -1498,8 +1500,10 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) if (!gst_video_frame_map (in_frame, &pad->in_info, mixcol->buffer, GST_MAP_READ | GST_MAP_GL)) { ++array_index; + pad->mapped = FALSE; continue; } + pad->mapped = TRUE; if (gst_is_gl_memory (in_frame->map[0].memory)) { in_tex = *(guint *) in_frame->data[0]; @@ -1523,7 +1527,8 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) in_width, in_height, in_width, in_height)) { GST_ELEMENT_ERROR (mix, RESOURCE, NOT_FOUND, ("%s", "Failed to init upload format"), (NULL)); - return FALSE; + res = FALSE; + goto out; } if (!pad->in_tex_id) @@ -1535,11 +1540,11 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) in_frame->data)) { GST_ELEMENT_ERROR (mix, RESOURCE, NOT_FOUND, ("%s", "Failed to upload video frame"), (NULL)); - return FALSE; + res = FALSE; + goto out; } in_tex = pad->in_tex_id; - pad->mapped = TRUE; } frame->texture = in_tex; @@ -1554,10 +1559,12 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) out_frame.data)) { GST_ELEMENT_ERROR (mix, RESOURCE, NOT_FOUND, ("%s", "Failed to download video frame"), (NULL)); - return FALSE; + res = FALSE; + goto out; } } +out: i = 0; walk = mix->sinkpads; while (walk) { @@ -1574,7 +1581,7 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf) gst_video_frame_unmap (&out_frame); - return TRUE; + return res; } static void |