GNOME Bugzilla – Bug 650258
matroskademux/matroskaparse: gst_element_query_duration returns wrong value for Matroska files
Last modified: 2011-06-15 22:43:31 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.
Created attachment 187870 [details] [review] matroskademux: calculate segment duration after parsing all the IDs Proposed fix.
(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 ..."
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)
Sample file: http://rishi.fedorapeople.org/bgo-650258.mkv Test code: http://rishi.fedorapeople.org/bgo-650258.c Do you need a test case?
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
Created attachment 187938 [details] [review] matroskaparse: calculate segment duration after parsing all the IDs Turns out that matroskaparse is affected too.
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