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 653080 - matroskamux: make check for block_duration less sensitive
matroskamux: make check for block_duration less sensitive
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-21 07:48 UTC by Oleksij Rempel
Modified: 2011-09-06 15:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.34 KB, patch)
2011-06-21 07:48 UTC, Oleksij Rempel
needs-work Details | Review
patch v2 (3.41 KB, patch)
2011-06-27 10:21 UTC, Oleksij Rempel
none Details | Review

Description Oleksij Rempel 2011-06-21 07:48:25 UTC
Created attachment 190343 [details] [review]
patch

some times frame duration can variate for 1 usecond,
in this cas matrosamux desidet to create BLOCKGROUP insted of
SIMPLEBLOCK.

Since matroska use mseconds, we do not need usec precision.

In this patch i reduce block_duration to 16 bit (msec), and make it
less sensible for usecond difference.
Comment 1 Sebastian Dröge (slomo) 2011-06-26 13:33:25 UTC
Review of attachment 190343 [details] [review]:

::: gst/matroska/matroska-mux.c
@@ +2768,3 @@
   /* Check if the duration differs from the default duration. */
   write_duration = FALSE;
+  block_duration = GST_TIME_AS_MSECONDS (GST_BUFFER_DURATION (buf));

Instead of GST_TIME_AS_MSECONDS you should do something that uses mux->time_scale

@@ +2771,3 @@
   if (GST_BUFFER_DURATION_IS_VALID (buf)) {
+    if (block_duration !=
+        GST_TIME_AS_MSECONDS (collect_pad->track->default_duration))

Maybe do this conversion a single time only. And allow a difference of +/- 1 ms for rounding errors.
Comment 2 Oleksij Rempel 2011-06-27 10:21:35 UTC
Created attachment 190741 [details] [review]
patch v2
Comment 3 Mark Nauwelaerts 2011-09-06 13:12:35 UTC
Made some modifications (also in line with previous comments):

commit aa0ae490d052eee96a56c845b599066aa00855e5
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Tue Sep 6 15:05:37 2011 +0200

    matroskamux: make default duration check less sensitive
    
    Frame duration might vary for 1 usecond, in this case matroskamux
    decides to create BLOCKGROUP instead of SIMPLEBLOCK.
    
    Convert duration to timecodescale which is (typically) less precise, and
    then also allow the difference of 1/-1 to arrange for less sensitive check.
    
    Based on patch by Alexey Fisher <bug-track@fisher-privat.net>
    
    Fixes #653080.
Comment 4 Oleksij Rempel 2011-09-06 14:50:39 UTC
Thank you ;)