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 619105 - [qtdemux] misalignment between index and sample while looking for frame
[qtdemux] misalignment between index and sample while looking for frame
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.22
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-19 16:12 UTC by Benjamin Gaignard
Modified: 2010-05-25 23:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for qtdemux (375 bytes, patch)
2010-05-19 16:13 UTC, Benjamin Gaignard
rejected Details | Review
Fix timestamp rounding to allow the correct index to be located. (890 bytes, patch)
2010-05-25 19:24 UTC, Robert Swain
committed Details | Review

Description Benjamin Gaignard 2010-05-19 16:12:26 UTC
in gst_qtdemux_find_index_linear function of qtdemux.c index variable isn't align on the parsed sample, so the research of the correct sample don't give the correct result.
Comment 1 Benjamin Gaignard 2010-05-19 16:13:25 UTC
Created attachment 161469 [details] [review]
patch for qtdemux
Comment 2 Robert Swain 2010-05-20 06:55:20 UTC
Review of attachment 161469 [details] [review]:

Looks good to me. I would set accepted-commit_after_freeze but I'll leave that to someone with greater authority. :)
Comment 3 Tim-Philipp Müller 2010-05-21 10:45:38 UTC
Are you sure this is correct?

It seems to me that result is always one ahead of the index counter on purpose. The code inspects the next sample (result, samples[index + 1]) to see if the time is greater than the seektime and if so returns the index (which is one behind and hence refers to the sample before the one inspected).

What does this fix for you exactly?
Comment 4 Robert Swain 2010-05-25 19:24:22 UTC
Created attachment 161972 [details] [review]
Fix timestamp rounding to allow the correct index to be located.

The issue was that scaling from GStreamer time format to mov time format was rounding down causing the timestamp of the newsegment event received after a flushing keyframe seek to find the sample index before the one it should causing further backward seeking to the keyframe prior until no rounding error occurred.

Rounding up when scaling to mov format has the desired effect and neither Wim nor I were certain whether just the _round () variant would be sufficient.
Comment 5 Tim-Philipp Müller 2010-05-25 23:16:46 UTC
Pushed, thanks:

commit 50273537dcc5a557fee3b24c9b0baf9abb4e5900
Author: Robert Swain <robert.swain@collabora.co.uk>
Date:   Tue May 25 21:14:05 2010 +0200

    qtdemux: Round timestamp up when scaling to mov format
    
    Fix timestamp rounding to allow the correct index to be located.
    
    The issue was that scaling from GStreamer time format to mov time format was
    rounding down causing the timestamp of the newsegment event received after a
    flushing keyframe seek to find the sample index before the one it should
    causing further backward seeking to the keyframe prior until no rounding error
    occurred.
    
    Rounding up when scaling to mov format has the desired effect, and it is
    not clear whether just the _round () variant would be sufficient.
    
    Fixes bug #619105