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 673102 - [kateenc] Fixed buffer duration
[kateenc] Fixed buffer duration
Status: RESOLVED DUPLICATE of bug 668833
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.22
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-29 18:41 UTC by Antoine Tremblay
Modified: 2012-03-30 15:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
path to remove the hack... (919 bytes, patch)
2012-03-29 18:43 UTC, Antoine Tremblay
none Details | Review

Description Antoine Tremblay 2012-03-29 18:41:34 UTC
There was a weird hack in kateenc that was messing up the buffers durations : 

-  /* Hack to flush each packet on its own page - taken off the CMML encoder element */
-  GST_BUFFER_DURATION (buffer) = G_MAXINT64;
-

This was breaking seeking in a matroska file containing kate encoded subtitles for example with vlc, since the total track duration was completely wack...

I do no understand what  " flush each packet on its own page" could mean... unless it was like each subtitle buffer would display on a different frame but still it makes no sense to have the wrong duration..  I checked the CMML encoder.. found no reference or any similar code...  

Also, I think if there was really a problem with the duration it should be set to GST_CLOCK_TIME_NONE, not to G_MAXINT64...

So unless somebody has a clear idea why this is needed ?  

Here's a patch to fix it by removing this "hack"
Comment 1 Antoine Tremblay 2012-03-29 18:43:01 UTC
Created attachment 210887 [details] [review]
path to remove the hack...
Comment 2 Antoine Tremblay 2012-03-30 15:24:47 UTC
Oops this was already fixed see :

https://bugzilla.gnome.org/show_bug.cgi?id=668833

commit e0b0604119fd7cfb2242605dcff10405ff0a1285
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Sat Jan 28 12:32:46 2012 +0000

    kateenc: remove 'flush every packet' hack

    This is a bad hack which does not work with Matroska, and is now
    obsolete as similar code is not included in oggmux/oggstream.

Setting as duplicate

*** This bug has been marked as a duplicate of bug 668833 ***
Comment 3 Vincent Penquerc'h 2012-03-30 15:46:32 UTC
> I do no understand what  " flush each packet on its own page" could mean...
> unless it was like each subtitle buffer would display on a different frame but
> still it makes no sense to have the wrong duration..  I checked the CMML
> encoder.. found no reference or any similar code...  
> 
> Also, I think if there was really a problem with the duration it should be set
> to GST_CLOCK_TIME_NONE, not to G_MAXINT64...

That was for hysterical raisins, and setting a very large packet duration (not no duration) was the only way to force oggmux to flush a page after the packet. Without this, oggmux would wait for another page to look at its timestamp before deciding whether to flush or not, as it was hoping it could wait for more data to fit more onto a page - but next kate buffer could be seconds or minutes later.

This is now obsolete as oggmux knows to flush discontinous codecs, but the hack had been forgotten till bug 668833 was reported.

The original cmmlenc hack was removed in 2010.