projects
/
platform
/
upstream
/
gst-plugins-good.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
91a3afc
)
icydemux: avoid copy when we can
author
Wim Taymans
<wim.taymans@collabora.co.uk>
Tue, 9 Apr 2013 15:34:12 +0000
(17:34 +0200)
committer
Wim Taymans
<wim.taymans@collabora.co.uk>
Tue, 9 Apr 2013 15:34:12 +0000
(17:34 +0200)
gst/icydemux/gsticydemux.c
patch
|
blob
|
history
diff --git
a/gst/icydemux/gsticydemux.c
b/gst/icydemux/gsticydemux.c
index
d32b415
..
b12bcb4
100644
(file)
--- a/
gst/icydemux/gsticydemux.c
+++ b/
gst/icydemux/gsticydemux.c
@@
-532,7
+532,12
@@
gst_icydemux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
while (size) {
if (icydemux->remaining) {
chunk = (size <= icydemux->remaining) ? size : icydemux->remaining;
- sub = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, chunk);
+ if (offset == 0 && chunk == size) {
+ sub = buf;
+ buf = NULL;
+ } else {
+ sub = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset, chunk);
+ }
offset += chunk;
icydemux->remaining -= chunk;
size -= chunk;
@@
-576,7
+581,8
@@
gst_icydemux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
}
done:
- gst_buffer_unref (buf);
+ if (buf)
+ gst_buffer_unref (buf);
return ret;