After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 321001 - [matroskademux] should seek to nearest preceding index entry, not nearest in any direction
[matroskademux] should seek to nearest preceding index entry, not nearest in ...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.9.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-08 19:29 UTC by Vincent Torri
Modified: 2005-11-15 19:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (7.64 KB, text/plain)
2005-11-08 19:30 UTC, Vincent Torri
  Details
simple fix (1.00 KB, patch)
2005-11-08 20:01 UTC, Vincent Torri
reviewed Details | Review
fix the case demux->num_indexes == 0 (1.05 KB, patch)
2005-11-08 23:33 UTC, Vincent Torri
committed Details | Review

Description Vincent Torri 2005-11-08 19:29:05 UTC
with a filesrc, a decodebin and a fakesink in a pipeline, I want to seek to some
frame number, get the frame data and then display it.

With an mkv file, the seek is not accurate. It seems to go to the next key
frame, and not the previous one, before doing the seek.

The video that I use are here :
http://www.iecn.u-nancy.fr/~torri/files/gstreamer_pb/
the video stream has been encoded with xvid.

Below is the test program that I use to test the seek and to retrieve the data
Comment 1 Vincent Torri 2005-11-08 19:30:14 UTC
Created attachment 54479 [details]
test program

Test program that shows the problem when seeking to a specific frame
Usage :
./seek video_file frame_number
Comment 2 Vincent Torri 2005-11-08 20:01:48 UTC
Created attachment 54481 [details] [review]
simple fix

simple fix for the seek with mkv : i loop over the indexes until the current
position is between the current index and the next one.
Comment 3 Tim-Philipp Müller 2005-11-08 21:02:18 UTC
Looks good, but:

 - the patch needs to handle the case demux->num_indexes == 0 as well
   (currently it would loop from 0 to (guint)-1 and then crash 
    at some point, wouldn't it?)

 - the patch assumes the index is sorted by time (ascending). It's probably
   a fairly good assumption, but I wouldn't rely on that and make sure
   it is sorted when adding index entries.

 Cheers
  -Tim
Comment 4 Vincent Torri 2005-11-08 23:33:37 UTC
Created attachment 54510 [details] [review]
fix the case demux->num_indexes == 0

if demux->num_indexes == 0 I return NULL
Indeed, I assumed that the list of index is sorted. I don't know if it is the
case or not, but it was the most straightforward thing to me :)
Comment 5 Tim-Philipp Müller 2005-11-15 19:42:54 UTC
Thanks, applied:

2005-11-15  Vincent Torri  <torri at iecn dot u-nancy dot fr>

       * gst/matroska/matroska-demux.c: (gst_matroskademux_do_index_seek):
         When seeking, seek to closest index entry at or before the requested
         seek position, not just the closest one (#321001).

 Cheers
  -Tim