send correct buffer offset after seek

Original commit message from CVS:
send correct buffer offset after seek
This commit is contained in:
Benjamin Otte 2003-11-24 21:36:59 +00:00
parent 25f85868d4
commit 63b0509428
2 changed files with 6 additions and 2 deletions

View file

@ -623,7 +623,7 @@ gst_filesrc_get_mmap (GstFileSrc *src)
/* subbuffer it */ /* subbuffer it */
buf = gst_buffer_create_sub (src->mapbuf, src->curoffset - nextmap, readsize); buf = gst_buffer_create_sub (src->mapbuf, src->curoffset - nextmap, readsize);
GST_BUFFER_OFFSET (buf) = mapstart + src->curoffset - nextmap; GST_BUFFER_OFFSET (buf) = GST_BUFFER_OFFSET (src->mapbuf) + src->curoffset - nextmap;
} }
} }
} }
@ -637,6 +637,8 @@ gst_filesrc_get_mmap (GstFileSrc *src)
} }
/* we're done, return the buffer */ /* we're done, return the buffer */
g_assert (src->curoffset == GST_BUFFER_OFFSET (buf));
g_print ("offset %u %u\n", (guint) src->curoffset, (guint) GST_BUFFER_OFFSET (buf));
src->curoffset += GST_BUFFER_SIZE(buf); src->curoffset += GST_BUFFER_SIZE(buf);
return buf; return buf;
} }

View file

@ -623,7 +623,7 @@ gst_filesrc_get_mmap (GstFileSrc *src)
/* subbuffer it */ /* subbuffer it */
buf = gst_buffer_create_sub (src->mapbuf, src->curoffset - nextmap, readsize); buf = gst_buffer_create_sub (src->mapbuf, src->curoffset - nextmap, readsize);
GST_BUFFER_OFFSET (buf) = mapstart + src->curoffset - nextmap; GST_BUFFER_OFFSET (buf) = GST_BUFFER_OFFSET (src->mapbuf) + src->curoffset - nextmap;
} }
} }
} }
@ -637,6 +637,8 @@ gst_filesrc_get_mmap (GstFileSrc *src)
} }
/* we're done, return the buffer */ /* we're done, return the buffer */
g_assert (src->curoffset == GST_BUFFER_OFFSET (buf));
g_print ("offset %u %u\n", (guint) src->curoffset, (guint) GST_BUFFER_OFFSET (buf));
src->curoffset += GST_BUFFER_SIZE(buf); src->curoffset += GST_BUFFER_SIZE(buf);
return buf; return buf;
} }