From 440f6c38f6c016521fe9030b859384c972289678 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 11 Apr 2003 00:59:50 +0000 Subject: [PATCH] fix iradio mode Original commit message from CVS: fix iradio mode --- ext/gnomevfs/gstgnomevfssrc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c index 56e7a7d3c4..4ddd8a8c1c 100644 --- a/ext/gnomevfs/gstgnomevfssrc.c +++ b/ext/gnomevfs/gstgnomevfssrc.c @@ -900,6 +900,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad) GnomeVFSResult result = 0; GstBuffer *buf; GnomeVFSFileSize readbytes; + guint8 *data; g_return_val_if_fail(pad != NULL, NULL); src = GST_GNOMEVFSSRC(gst_pad_get_parent(pad)); @@ -922,6 +923,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad) if (src->iradio_mode && src->icy_metaint > 0) { GST_BUFFER_DATA (buf) = g_malloc0 (src->icy_metaint); + data = GST_BUFFER_DATA (buf); g_return_val_if_fail (GST_BUFFER_DATA (buf) != NULL, NULL); GST_BUFFER_SIZE (buf) = 0; @@ -930,7 +932,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad) do { GST_DEBUG (0,"doing read: icy_count: %" G_GINT64_FORMAT, src->icy_count); - result = gnome_vfs_read (src->handle, GST_BUFFER_DATA (buf), + result = gnome_vfs_read (src->handle, data, src->icy_metaint - src->icy_count, &readbytes); @@ -945,6 +947,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad) src->icy_count += readbytes; GST_BUFFER_OFFSET (buf) = src->curoffset; GST_BUFFER_SIZE (buf) += readbytes; + data += readbytes; src->curoffset += readbytes; if (src->icy_count == src->icy_metaint) {