Commit f7b9b177 authored by Benjamin Otte's avatar Benjamin Otte
Browse files

filesrc needs to be reffed by buffers that use its mmaped data directly

Original commit message from CVS:
filesrc needs to be reffed by buffers that use its mmaped data directly
parent 9bd63079
...@@ -370,6 +370,7 @@ gst_filesrc_free_parent_mmap (GstBuffer *buf) ...@@ -370,6 +370,7 @@ gst_filesrc_free_parent_mmap (GstBuffer *buf)
GST_BUFFER_DATA (buf) = NULL; GST_BUFFER_DATA (buf) = NULL;
g_object_unref (src);
gst_buffer_default_free (buf); gst_buffer_default_free (buf);
} }
...@@ -414,6 +415,7 @@ gst_filesrc_map_region (GstFileSrc *src, off_t offset, size_t size) ...@@ -414,6 +415,7 @@ gst_filesrc_map_region (GstFileSrc *src, off_t offset, size_t size)
GST_BUFFER_OFFSET (buf) = offset; GST_BUFFER_OFFSET (buf) = offset;
GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE; GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE;
GST_BUFFER_POOL_PRIVATE (buf) = src; GST_BUFFER_POOL_PRIVATE (buf) = src;
g_object_ref (src);
GST_BUFFER_FREE_FUNC (buf) = (GstDataFreeFunction) gst_filesrc_free_parent_mmap; GST_BUFFER_FREE_FUNC (buf) = (GstDataFreeFunction) gst_filesrc_free_parent_mmap;
g_mutex_lock (src->map_regions_lock); g_mutex_lock (src->map_regions_lock);
......
...@@ -370,6 +370,7 @@ gst_filesrc_free_parent_mmap (GstBuffer *buf) ...@@ -370,6 +370,7 @@ gst_filesrc_free_parent_mmap (GstBuffer *buf)
GST_BUFFER_DATA (buf) = NULL; GST_BUFFER_DATA (buf) = NULL;
g_object_unref (src);
gst_buffer_default_free (buf); gst_buffer_default_free (buf);
} }
...@@ -414,6 +415,7 @@ gst_filesrc_map_region (GstFileSrc *src, off_t offset, size_t size) ...@@ -414,6 +415,7 @@ gst_filesrc_map_region (GstFileSrc *src, off_t offset, size_t size)
GST_BUFFER_OFFSET (buf) = offset; GST_BUFFER_OFFSET (buf) = offset;
GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE; GST_BUFFER_TIMESTAMP (buf) = GST_CLOCK_TIME_NONE;
GST_BUFFER_POOL_PRIVATE (buf) = src; GST_BUFFER_POOL_PRIVATE (buf) = src;
g_object_ref (src);
GST_BUFFER_FREE_FUNC (buf) = (GstDataFreeFunction) gst_filesrc_free_parent_mmap; GST_BUFFER_FREE_FUNC (buf) = (GstDataFreeFunction) gst_filesrc_free_parent_mmap;
g_mutex_lock (src->map_regions_lock); g_mutex_lock (src->map_regions_lock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment