GNOME Bugzilla – Bug 543591
Gnonlin can not play theora streams
Last modified: 2009-03-23 10:43:41 UTC
Please describe the problem: Gnonlin should be able to play theora files (in ogg or anything else) from second 0 to whenever but will only play the file when it has to seek forward a few seconds first (thus can not play from the start to end). this only happens with larger quality theora files encoded with a 'new' encoder (anything pre 2005 or so seems to work regardless) Steps to reproduce: 1. create a theora file with the command 'gst-launch -v videotestsrc num-buffers=1000 ! theoraenc quality=63 ! oggmux ! filesink location=videotestsrc.ogg' 2. create a gnlcomposition element 3. add a gnlfilesource (or gnlsource with your own decoder added to that) and add it to the gnlcomposition 4. set the gnlfilesources media-start to 0, the duration can be anything greater than 0 5. link the gnlcomposition to the rest of a video output pipeline 6. play the pipeline Actual results: gnonlin attempts to sink to 0 seconds in the theora file, the theora encoder produces the following warning '0:00:01.437480974 3781 0x8342378 WARN bin gstbin.c:2080:do_bin_latency:<pipeline> failed to query latency' and emits its eos message. thus no video is played Expected results: gnonlin should play the video from media-start (set to 0 seconds) to media-duration (whatever you set that as). Does this happen every time? this happens constantly with higher quality encoded theora with a 'new' encoder (gstreamer or anything else new i find). other media that is not theora plays fine, theora at lower quality (less than 21) also plays fine. Other information: changing the media-start to around six seconds or higher the theora file will play fine.
Created attachment 114769 [details] theora gnonlin bug test-case test-case to demonstrate the bug
I confirm it also fails here with full cvs.
ok, it's still broken even after the gnlfilesource fixes. Looks to be the combination of oggdemux/theoradec freaking out seeking back to 0. It can be reproduced (with git gnonlin) with the following command: gst-launch-0.10 gnlfilesource location=videotestsrc.ogg duration=10000000000 media-start=0 media-duration=10000000000 ! xvimagesink
Created attachment 131110 [details] [review] Fix convert_sink with negative framecounts After going deeper at this, the problem was in the _theora_granulepos_start_time method, which didn't check whether the framecount was negative or not. This patch fixes that by returning GST_CLOCK_TIME_NONE if the framecount is negative instead of some insanely big time value. Comments from a theora(dec) maintainer/expert most welcome. This should fix all remaining issues with using theora files with gnonlin.
commit b7fdb7c6d71b7185ac54b94d7182219a51316210 Author: Edward Hervey <bilboed@bilboed.com> Date: Mon Mar 23 11:38:53 2009 +0100 theoradec: Use GST_CLOCK_TIME_NONE for invalid positions. Fixes #543591 The problem was that previously we didn't check whether _theora_granule_frame returned a negative framecount or not, resulting in bogus timestamps. diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index d9d8fcd..60e2ef2 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -249,10 +249,11 @@ _theora_granule_start_time (GstTheoraDec * dec, gint64 granulepos) /* invalid granule results in invalid time */ if (granulepos == -1) - return -1; + return GST_CLOCK_TIME_NONE; /* get framecount */ - framecount = _theora_granule_frame (dec, granulepos); + if ((framecount = _theora_granule_frame (dec, granulepos)) < 0) + return GST_CLOCK_TIME_NONE; return gst_util_uint64_scale_int (framecount * GST_SECOND, dec->info.fps_denominator, dec->info.fps_numerator);