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 733226 - katedec: properly handle segment and caps events
katedec: properly handle segment and caps events
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-15 22:18 UTC by Thiago Sousa Santos
Modified: 2014-07-21 15:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
katedec: handle streamheaders in caps (11.25 KB, patch)
2014-07-15 22:18 UTC, Thiago Sousa Santos
committed Details | Review
katedec: handle segment event earlier (1.49 KB, patch)
2014-07-15 22:18 UTC, Thiago Sousa Santos
committed Details | Review

Description Thiago Sousa Santos 2014-07-15 22:18:24 UTC
katedec doesn't read the streamheaders from caps and causes playback to fails when playback doesn't start from the beginning of the file (where the streamheaders are). It also fails to handle segment events properly. The following patches fix this.
Comment 1 Thiago Sousa Santos 2014-07-15 22:18:28 UTC
Created attachment 280758 [details] [review]
katedec: handle streamheaders in caps

Properly handle the caps event by configuring the kate decoding lib using the
available streamheaders. This makes it possible to decode kate subtitles when
the stream is seeked before katedec gets the initial buffers that are usually
the streamheaders.
Comment 2 Thiago Sousa Santos 2014-07-15 22:18:33 UTC
Created attachment 280759 [details] [review]
katedec: handle segment event earlier

Delaying the segment event to when caps are decided can cause issues as
the first thing katedec does on its chain function it doing a segment clip.
It will lead to an assertion if the segment format is undefined
Comment 3 Sebastian Dröge (slomo) 2014-07-16 14:55:09 UTC
Comment on attachment 280759 [details] [review]
katedec: handle segment event earlier

You'll need to make sure however that segment events are always sent after the caps event
Comment 4 Thiago Sousa Santos 2014-07-17 16:22:37 UTC
(In reply to comment #3)
> (From update of attachment 280759 [details] [review])
> You'll need to make sure however that segment events are always sent after the
> caps event

It will be sent on the same order it is received. I guess we should assume that upstream will send it in the correct order, otherwise the bug is in upstream.
Comment 5 Sebastian Dröge (slomo) 2014-07-17 16:33:48 UTC
Is katedec always sending a caps event immediately when it receives on itself? Or can it in theory be delayed until it parsed a buffer or two?
Comment 6 Thiago Sousa Santos 2014-07-17 16:47:12 UTC
It delays events (except stream-start) to after it got the stream headers so it can push the caps before pushing the other events (segment and tags, usually).

This patch only makes it apply the segment to its internal attribute, but it will only forward it downstream after it has processed the headers and set a caps.
Comment 7 Thiago Sousa Santos 2014-07-21 15:49:07 UTC
commit e26e112e80c4d3462d98421a2c9fe144215234f2
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Tue Jul 15 16:42:57 2014 -0300

    katedec: handle segment event earlier
    
    Delaying the segment event to when caps are decided can cause issues as
    the first thing katedec does on its chain function it doing a segment clip.
    It will lead to an assertion if the segment format is undefined
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733226

commit b0e63bbb9bde4fe5c53db23ae7539c43f1e5f549
Author: Thiago Santos <ts.santos@sisa.samsung.com>
Date:   Tue Jul 15 16:41:51 2014 -0300

    katedec: handle streamheaders in caps
    
    Properly handle the caps event by configuring the kate decoding lib using th
    available streamheaders. This makes it possible to decode kate subtitles whe
    the stream is seeked before katedec gets the initial buffers that are usuall
    the streamheaders.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733226