diff options
Diffstat (limited to 'gst/icydemux/gsticydemux.c')
-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; |