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 543591 - Gnonlin can not play theora streams
Gnonlin can not play theora streams
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-18 13:11 UTC by Gordon Allott
Modified: 2009-03-23 10:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
theora gnonlin bug test-case (2.98 KB, text/plain)
2008-07-18 13:12 UTC, Gordon Allott
  Details
Fix convert_sink with negative framecounts (912 bytes, patch)
2009-03-22 08:53 UTC, Edward Hervey
committed Details | Review

Description Gordon Allott 2008-07-18 13:11:15 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.
Comment 1 Gordon Allott 2008-07-18 13:12:34 UTC
Created attachment 114769 [details]
theora gnonlin bug test-case

test-case to demonstrate the bug
Comment 2 Edward Hervey 2008-08-27 09:13:13 UTC
I confirm it also fails here with full cvs.
Comment 3 Edward Hervey 2009-03-21 16:27:31 UTC
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

Comment 4 Edward Hervey 2009-03-22 08:53:05 UTC
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.
Comment 5 Edward Hervey 2009-03-23 10:43:41 UTC
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);