GNOME Bugzilla – Bug 642942
adder: offset_end field of outgoing buffers is set to GST_BUFFER_OFFSET_NONE
Last modified: 2011-02-24 12:30:24 UTC
Created attachment 181555 [details] [review] proposed patch adder does not set the offset_end field of its output buffers. If the input buffers on the sink pads have exactly the same offsets and offsets_end, then that's OK, because in gst_adder_collected, the call to gst_collect_pads_take_buffer will return an unmodified input buffer from the first sink pad -- and this will have the offset_end field filled in by the upstream pipeline. That buffer is recycled as the output buffer, so it already has all of its metadata set. However, if the sink pads have offsets and offsets_end that don't exactly line up, then gst_collect_pads_take_buffer will have to return a new buffer, either by merging existing buffers or by creating a sub-buffer. This new buffer will have the offset_end field set to GST_BUFFER_OFFSET_NONE. The attached script reproduces this error. It consists of a pipeline with two audiotestsrc's with different values of the "samplesperbuffer" property, both attached to an adder. The timestamp, duration, offset, and offset_end fields will look like this: 0 7812500 0 18446744073709551615 7812500 7812500 128 18446744073709551615 15625000 7812500 256 18446744073709551615 ... Either set both "samplesperbuffer" properties to the same value, or apply the attached patch, and the offset_end fields get filled in: 0 7812500 0 128 7812500 7812500 128 256 15625000 7812500 256 384 ... The attached patch adds code to fill in the offset_end field.
Created attachment 181556 [details] [review] Python script demonstrating bug
commit 27178f7aff309132ce32bba1d995ab59d2466eeb Author: Leo Singer <leo.singer@ligo.org> Date: Mon Feb 21 20:34:41 2011 -0800 adder: Fill in offset_end field of outgoing buffers ... rather than leave it as GST_BUFFER_OFFSET_NONE Fix bug #642942.