[Bug 749653] dashdemux: Implement binary search for stream_sidx_seek

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Jul 28 08:01:29 PDT 2015


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

Thiago Sousa Santos <thiagossantos at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #304492|none                        |reviewed
             status|                            |

--- Comment #18 from Thiago Sousa Santos <thiagossantos at gmail.com> ---
Review of attachment 304492:
 --> (https://bugzilla.gnome.org/review?bug=749653&attachment=304492)

::: ext/dash/gstdashdemux.c
@@ +928,3 @@
+      sizeof (GstSidxBoxEntry),
+      (GCompareDataFunc) gst_dash_demux_index_entry_search,
+      GST_SEARCH_MODE_AFTER, &ts, NULL);

Don't we want GST_SEARCH_MODE_BEFORE here?

Suppose you have the following entries:
entry[0] = 0
entry[1] = 10
entry[2] = 20

If you seek to 5, you want to start from 0, not from 10, right?

@@ +940,2 @@
   else
     dashstream->sidx_current_remaining = 0;

Assuming pts is a non-negative value and if we use GST_SEARCH_MODE_BEFORE,
there is still a chance that we are seeking after the last element and we will
get the last one. In this case we want to go with the 'else' option here. This
should need special handling. Maybe before doing the binary search just check
if the ts is already past the last element on the entries array.

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