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 650258 - matroskademux/matroskaparse: gst_element_query_duration returns wrong value for Matroska files
matroskademux/matroskaparse: gst_element_query_duration returns wrong value f...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-15 20:22 UTC by Debarshi Ray
Modified: 2011-06-15 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
matroskademux: calculate segment duration after parsing all the IDs (2.48 KB, patch)
2011-05-15 20:26 UTC, Debarshi Ray
committed Details | Review
matroskaparse: calculate segment duration after parsing all the IDs (2.48 KB, patch)
2011-05-16 23:12 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2011-05-15 20:22:37 UTC
The problem originates from gst_matroska_demux_parse_info using the default value of demux->time_scale to calculate the segment duration in nanoseconds if GST_MATROSKA_ID_TIMECODESCALE precedes GST_MATROSKA_ID_DURATION instead of succeeding it. Mplayer is able to deal with it, so probably Gstreamer should too.
Comment 1 Debarshi Ray 2011-05-15 20:26:23 UTC
Created attachment 187870 [details] [review]
matroskademux: calculate segment duration after parsing all the IDs

Proposed fix.
Comment 2 Debarshi Ray 2011-05-15 20:31:44 UTC
(In reply to comment #0)
> GST_MATROSKA_ID_TIMECODESCALE precedes GST_MATROSKA_ID_DURATION instead of
> succeeding

Should be:

"... GST_MATROSKA_ID_TIMECODESCALE succeedes GST_MATROSKA_ID_DURATION instead of
preceding ..."
Comment 3 Tim-Philipp Müller 2011-05-15 21:31:51 UTC
Sounds like it. Could you make a sample file available by any chance? (maybe the first 1MB is enoug to reproduce it, but I suspect not: head --bytes=990k foo.mkv > head.mkv)
Comment 4 Debarshi Ray 2011-05-15 22:21:43 UTC
Sample file: http://rishi.fedorapeople.org/bgo-650258.mkv
Test code: http://rishi.fedorapeople.org/bgo-650258.c

Do you need a test case?
Comment 5 Sebastian Dröge (slomo) 2011-05-16 06:57:23 UTC
commit bdc464a778e26bea0201e66b12473886488c2ef0
Author: Debarshi Ray <rishi@gnu.org>
Date:   Sun May 15 23:25:15 2011 +0300

    matroskademux: calculate segment duration after parsing all the IDs
    
    Since the segment duration is given in terms of the
    GST_MATROSKA_ID_TIMECODESCALE we should only convert it into
    nanoseconds when we are sure that any scale specified in the file has
    been read.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=650258
Comment 6 Debarshi Ray 2011-05-16 23:12:16 UTC
Created attachment 187938 [details] [review]
matroskaparse: calculate segment duration after parsing all the IDs

Turns out that matroskaparse is affected too.
Comment 7 Sebastian Dröge (slomo) 2011-05-17 07:04:16 UTC
commit 4df5d896f096c6ab730ba8f7cb2e9af6ff412b03
Author: Debarshi Ray <rishi@gnu.org>
Date:   Sun May 15 23:25:15 2011 +0300

    matroskaparse: calculate segment duration after parsing all the IDs
    
    Since the segment duration is given in terms of the
    GST_MATROSKA_ID_TIMECODESCALE we should only convert it into
    nanoseconds when we are sure that any scale specified in the file has
    been read.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=650258