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 586891 - [qtdemux] skips all tracks in a media file because of their duration
[qtdemux] skips all tracks in a media file because of their duration
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: NONE
Assigned To: Julien MOUTTE
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-24 21:39 UTC by Julien MOUTTE
Modified: 2013-08-21 18:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Compare trak duration with complete duration correctly. (1.24 KB, patch)
2009-06-24 21:40 UTC, Julien MOUTTE
needs-work Details | Review
debug log (gzipped) (67.14 KB, application/x-gzip)
2009-06-26 15:41 UTC, Tim-Philipp Müller
  Details
rewrite code for clarity (1.48 KB, patch)
2009-07-01 10:27 UTC, Tim-Philipp Müller
rejected Details | Review
Patch adjusting global duration using the tracks and delaying pad adding. (12.11 KB, patch)
2009-07-17 14:18 UTC, Julien MOUTTE
none Details | Review
Improved patch (12.20 KB, patch)
2009-07-23 17:53 UTC, Julien MOUTTE
rejected Details | Review

Description Julien MOUTTE 2009-06-24 21:39:34 UTC
I have a test clip here that does not play with qtdemux. No stream are being demuxed because each trak has a duration that enters the *HACK* if case checking for duration.

I don't really understand that code and how it checks the trak duration. I tried rewriting it myself and now the file works, so I might misunderstand the way timescale needs to be applied or the code was wrong. Will attach a patch for review.
Comment 1 Julien MOUTTE 2009-06-24 21:40:39 UTC
Created attachment 137343 [details] [review]
Compare trak duration with complete duration correctly.
Comment 2 Edward Hervey 2009-06-25 09:53:44 UTC
looks like the hack had a typo bug in the tdur1/tdur2 calculations (those variables could be renamed for easier reading btw).

The patch therefore makes sense to me.
Comment 3 Julien MOUTTE 2009-06-25 11:32:47 UTC
Patch committed to GIT. Closing bug.
Comment 4 Tim-Philipp Müller 2009-06-26 15:35:32 UTC
Reopening, since this causes regressions with other clips for me.
Comment 5 Tim-Philipp Müller 2009-06-26 15:41:07 UTC
Created attachment 137427 [details]
debug log (gzipped)
Comment 6 Tim-Philipp Müller 2009-06-29 16:29:11 UTC
I have more files that fail to play now that used to play with the last release.

I propose to revert this patch until this gets sorted out.

Ping me on IRC for sample files.
Comment 7 Tim-Philipp Müller 2009-07-01 09:02:02 UTC
And reverted. Thanks for the riveting discussion.

 commit f6a12114953214d65560b084197362e814376d17
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Wed Jul 1 09:32:42 2009 +0100

    Revert "qtdemux: Make sure we don't blacklist streams by wrongly comparing their"
    
    This reverts commit 5503a59a5779b67451d8a271000181790ee76bc7.
    
    Reverting this since it causes regressions with a lot of sample files
    I have, all of which worked fine with the last -good release (#586891).

Comment 8 Tim-Philipp Müller 2009-07-01 10:27:11 UTC
Created attachment 137680 [details] [review]
rewrite code for clarity

I am not convinced the patch is correct. As I understand it, timescale is a *divisor*. The multiplication with the 'wrong' timescale (the presumed typo) should work out just fine (ie. like a division by the 'right' timescale values) when doing the durA/durB calculation later on, since (d1/ts1)/(d2/ts2) = (d1*ts2)/(d2*ts1). Bonus points for clarity this doesn't get of course.

Attaching a hopefully clearer version of the code. I don't think it changes the logic though.

If you could make your sample file available, that would be much appreciated.

Edward suggested looking at the index and blacklisting streams with just one chunk instead of looking at the duration. Would that make things work with your file?
Comment 9 Julien MOUTTE 2009-07-17 14:18:31 UTC
Created attachment 138596 [details] [review]
Patch adjusting global duration using the tracks and delaying pad adding.

This patch tries to fix the global duration at various steps :

1) When timescale is 0 it tries to initialize it with a valid duration from a track.
2) When the global duration is really wrong compared to the longest track it gets adjusted.

Introduced a function to destroy a stream which fixes various memleaks when stream creation fails.
Comment 10 Julien MOUTTE 2009-07-23 17:53:02 UTC
Created attachment 139091 [details] [review]
Improved patch

This patch will fix duration reading depending on the version number. It will also check the number of samples on top of the track duration before discarding it as a image header.
Comment 11 Sebastian Dröge (slomo) 2009-09-10 08:09:49 UTC
What's the state of this bug?
Comment 12 Tobias Mueller 2010-04-09 10:49:25 UTC
Reopening as I can't see any open question
Comment 13 Sebastian Dröge (slomo) 2011-05-26 10:03:22 UTC
And ping again ;)

Julien's change makes sense, Tim's change multiplies a factor of GST_SECOND to the durations but other than that makes sense too... can we get both in? Any reason not to?
Comment 14 Tim-Philipp Müller 2011-05-26 10:23:08 UTC
Is this even still a problem with current qtdemux?


> Any reason not to?

We're flying blind, ie. don't have a sample file.
Comment 15 Sebastian Dröge (slomo) 2013-08-21 18:12:49 UTC
No feedback at all, so let's get rid of this bug.