[Bug 782118] qtdemux: Fix seeking on streams with frame reordering

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Mar 5 11:24:41 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=782118

--- Comment #8 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
(In reply to Nicolas Dufresne (stormer) from comment #5)
> Review of attachment 350966 [details] [review]:
> 
> ::: gst/isomp4/qtdemux.c
> @@ +1163,3 @@
> +    while (index < str->n_samples - 1) {
> +      if (!qtdemux_parse_samples (qtdemux, str, index + 1))
> +        goto parse_failed;
> 
> Actually, there is a possible corner case. If the position is passed that
> last DTS, which happens when you seek to the last sample, it will reach
> parse_failed. While it should pick the last sample as if it was searching
> backward.
> 
> DTS: 0 1 2
> PTS: 1 3 2
> 
> The algo works for seeking at 1 and 2, but not 3.

This is actually wrong. If we seek to 3, what will happen is that all samples
up to n_samples (3) - 2 + 1 == 2 are parsed (i.e. we parsed 0, 1, 2) and then
the while loop finishes and we start looking backwards from the last sample
(2).

This loop would only ever run into parse_failed if the parsing itself of the
sample fails. It will never ever try to call qtdemux_parse_samples() with
index==n_samples.


There was a different minor bug though, which is fixed now. And your other
review comments too. I'll merge this right after 1.14 unless someone finds
another problem :)

-- 
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