[Bug 730053] baseparse: allow skipping more data than currently available
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Mon May 19 02:16:01 PDT 2014
https://bugzilla.gnome.org/show_bug.cgi?id=730053
GStreamer | gstreamer (core) | git
Sebastian Dröge (slomo) <slomo> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #276446|none |needs-work
status| |
--- Comment #1 from Sebastian Dröge (slomo) <slomo at coaxion.net> 2014-05-19 09:15:57 UTC ---
Review of attachment 276446:
--> (https://bugzilla.gnome.org/review?bug=730053&attachment=276446)
::: libs/gst/base/gstbaseparse.c
@@ +1998,3 @@
+ } else {
+ GST_DEBUG
+ ("This is more than available, flyshing %u, storing %u to skip",
av,
Typo: flyshing :)
skip is an int in the strict (signed), but here you print the values with %u.
It probably should all be unsigned everywhere? But then how do you distinguish
"unset"==-1?
@@ +2745,3 @@
+ gsize bsize = gst_buffer_get_size (buffer);
+ GST_DEBUG ("Got %u buffer, need to skip %u", (unsigned) bsize,
+ (unsigned) parse->priv->skip);
G_GSIZE_FORMAT for gsize btw
@@ +2748,3 @@
+ if (parse->priv->skip >= bsize) {
+ parse->priv->skip -= bsize;
+ GST_DEBUG ("All the buffer is eaten");
s/eaten/skipped/ maybe?
@@ +2754,3 @@
+ }
+ buffer = gst_buffer_make_writable (buffer);
+ gst_buffer_resize (buffer, parse->priv->skip, bsize - parse->priv->skip);
It's cheaper to push into the adapter and then just flush the remaining skip
bytes
@@ +2757,3 @@
+ parse->priv->offset += parse->priv->skip;
+ GST_DEBUG ("Done eating, we have %u left on this buffer",
+ (unsigned) gst_buffer_get_size (buffer));
gst_buffer_get_size() can be relatively expensive, also G_GSIZE_FORMAT
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list