mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
rawparse: use size of buffer we got from adapter
Otherwise position in stream could be wrong if subclass 'pre_push_frame' method changes the buffer size. https://bugzilla.gnome.org/show_bug.cgi?id=760270
This commit is contained in:
parent
a90f35e14b
commit
6e8278c51e
1 changed files with 4 additions and 2 deletions
|
@ -233,10 +233,12 @@ gst_raw_parse_push_buffer (GstRawParse * rp, GstBuffer * buffer)
|
|||
GstFlowReturn ret;
|
||||
gint nframes;
|
||||
GstRawParseClass *rpclass;
|
||||
gsize size;
|
||||
|
||||
rpclass = GST_RAW_PARSE_GET_CLASS (rp);
|
||||
|
||||
nframes = gst_buffer_get_size (buffer) / rp->framesize;
|
||||
size = gst_buffer_get_size (buffer);
|
||||
nframes = size / rp->framesize;
|
||||
|
||||
if (rp->segment.rate < 0) {
|
||||
rp->n_frames -= nframes;
|
||||
|
@ -267,7 +269,7 @@ gst_raw_parse_push_buffer (GstRawParse * rp, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
if (rp->segment.rate >= 0) {
|
||||
rp->offset += gst_buffer_get_size (buffer);
|
||||
rp->offset += size;
|
||||
rp->n_frames += nframes;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue