GNOME Bugzilla – Bug 653080
matroskamux: make check for block_duration less sensitive
Last modified: 2011-09-06 15:05:56 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.
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.
Created attachment 190741 [details] [review] patch v2
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.
Thank you ;)