diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-04-09 17:32:28 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-04-09 17:32:28 +0200 |
commit | 7768342230450559509e3e593b2ea33e81ea0ca4 (patch) | |
tree | 3ce7d190eb4d9b3f3740f40bf22dcf3f1d16325b | |
parent | a237a55eb1bc739b7edbf58c4fd547ad171085e1 (diff) |
icydemux: avoid subbuffer when we can
-rw-r--r-- | gst/icydemux/gsticydemux.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/icydemux/gsticydemux.c b/gst/icydemux/gsticydemux.c index 4a533b921..16dc2cf42 100644 --- a/gst/icydemux/gsticydemux.c +++ b/gst/icydemux/gsticydemux.c @@ -543,7 +543,12 @@ gst_icydemux_chain (GstPad * pad, GstBuffer * buf) while (size) { if (icydemux->remaining) { chunk = (size <= icydemux->remaining) ? size : icydemux->remaining; - sub = gst_buffer_create_sub (buf, offset, chunk); + if (offset == 0 && chunk == size) { + sub = buf; + buf = NULL; + } else { + sub = gst_buffer_create_sub (buf, offset, chunk); + } offset += chunk; icydemux->remaining -= chunk; size -= chunk; @@ -585,7 +590,8 @@ gst_icydemux_chain (GstPad * pad, GstBuffer * buf) } done: - gst_buffer_unref (buf); + if (buf) + gst_buffer_unref (buf); return ret; |