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 656115 - mpegpsdemux: handle SCR jumps/discontinuities more gracefully
mpegpsdemux: handle SCR jumps/discontinuities more gracefully
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal major
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-07 18:07 UTC by Oleksij Rempel
Modified: 2011-12-10 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch v1 (1.49 KB, patch)
2011-08-07 18:07 UTC, Oleksij Rempel
reviewed Details | Review
patch v2 (1.33 KB, patch)
2011-11-29 11:26 UTC, Oleksij Rempel
committed Details | Review

Description Oleksij Rempel 2011-08-07 18:07:26 UTC
Created attachment 193384 [details] [review]
patch v1

One of my dvds jump on some position and miss about 1 minute of stream.
The reason was mpeg timestamps. On some position scr difference is negative.
It produced negative timestamps. Since it was converted to unsigned value,
gstreamer timestamps was invalid. Instead of increasing mpeg ts,
they was decreasing till it started to be positive.
Comment 1 Vincent Penquerc'h 2011-11-29 11:14:18 UTC
Review of attachment 193384 [details] [review]:

Since the code just above specifically tests if the new ts is higher or lower and orders
the operation based on this, it would make more sense to just make diff a guint64 in the
first place. The check should then just work without having to test for < 0.
Various typos/spelling/grammar mistakes too (diffenrence, reajust, they was, scip).
I think you're not a native English speaker, but some are easily fixed on re-read typos.
Comment 2 Oleksij Rempel 2011-11-29 11:26:07 UTC
Created attachment 202362 [details] [review]
patch v2
Comment 3 Vincent Penquerc'h 2011-12-09 15:40:50 UTC
I pushed this a while ago but forgot to close the bug:

commit 2099a3945957fa0ddf10cd8b2ddef0e54f86bcdf
Author: Alexey Fisher <bug-track@fisher-privat.net>
Date:   Tue Nov 29 12:20:51 2011 +0100

    mpegpsdemux: recalculate adjust if difference is negative
    
    One of my dvds jump on some position and miss about 1 minute of stream.
    The reason was mpeg timestamps. On some position scr difference is negative.
    It produced negative timestamps. Since it was converted to unsigned value,
    gstreamer timestamps was invalid. Instead of increasing mpeg ts,
    they was decreasing till it started to be positive.
    
    The jump in timestamps caused mpeg2dec to skip frames to make QoS happy.
    
    This patch just make diff unsigned to avoid negative values.
    
    Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656115
Comment 4 Tim-Philipp Müller 2011-12-09 18:25:30 UTC
I have updated the summary to be hopefully more concise, please update it or change it back if I misunderstood the gist of these changes.
Comment 5 Matej Knopp 2011-12-10 04:31:34 UTC
I am probably missing something here, but his is how the diff is computed

    if (G_UNLIKELY (old_scr > scr_adjusted))
      diff = old_scr - scr_adjusted;
    else
      diff = scr_adjusted - old_scr;

what difference does it make whether it's signed or not?
Comment 6 Oleksij Rempel 2011-12-10 09:00:16 UTC
in some cases where old_scr is really big and scr_adjusted really small, then you will get really big _unsigned_ diff. If the diff is signed then you will get negative diff.
Comment 7 Matej Knopp 2011-12-10 11:55:52 UTC
That's the part I don't quite get. SCR is in mpeg time, so it has original resolution of 33 bits. How can it get so big it overflows gint64 ?
Comment 8 Oleksij Rempel 2011-12-10 12:49:20 UTC
i do not know. I didn't had time to research this problem deeper. May be diff is just top of the iceberg.
Comment 9 Matej Knopp 2011-12-10 13:16:11 UTC
That's what I was thinking. If it overflows the problem might be somewhere else.
Comment 10 Oleksij Rempel 2011-12-10 13:18:52 UTC
if you wont to investigate this problem i can check if i have some samples now, or if i will get it in the future. if you just curios, then i do not really have time for it now.
Comment 11 Matej Knopp 2011-12-10 13:20:45 UTC
If you can provide some samples I'd like to have a look. At least to see if the samples are broken or there is something wrong with the demuxer.
Comment 12 Oleksij Rempel 2011-12-10 13:38:13 UTC
Just checked: the samples i currently have are not affected. The problem with this bug is, the jump in video is "invisible", except you know what is there. So to track it down is good to send a big error message at least to console. I will keep my eyes open, if i will not forget to keep my warning patch in the source. Or you can add some warning patch to the git source... :)