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 340346 - [matroskamux] blocks upon muxing video and vorbis-audio
[matroskamux] blocks upon muxing video and vorbis-audio
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.2
Other Linux
: Normal normal
: 0.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-01 21:24 UTC by Mark Nauwelaerts
Modified: 2006-05-03 18:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Possible patch. (2.68 KB, patch)
2006-05-01 21:32 UTC, Mark Nauwelaerts
committed Details | Review
force new clusters only on VIDEO keyframes; don't feed NULL codec_ids to strcmp() (2.59 KB, patch)
2006-05-03 18:21 UTC, Tim-Philipp Müller
committed Details | Review

Description Mark Nauwelaerts 2006-05-01 21:24:05 UTC
Vorbisenc first sends the vorbis packet-headers in buffers with GST_CLOCK_TIME_NONE.  This is OK, but the muxing-code in matroskamux (inadvertently) ranks such buffers as "+infinity" in time.
As such, audio-data would only be muxed in after all the video has passed.
Comment 1 Mark Nauwelaerts 2006-05-01 21:32:17 UTC
Created attachment 64639 [details] [review]
Possible patch.

Patch that changes a few things in matroskamux:
- muxing code now selects GST_CLOCK_TIME_NONE before others (not last)
(as there should only few such buffers that have to come through)
- vorbis headers are dropped from the stream (as they are already retrieved from caps and placed in matroska header), in symmetry with their insertion in matroskademux
- matroska clusters are now "better" aligned with keyframes;
makes seek happen without complaints from decoder :)
Comment 2 Tim-Philipp Müller 2006-05-03 14:58:09 UTC
 2006-05-03  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: Mark Nauwelaerts  <manauw at skynet be>

        * gst/matroska/matroska-mux.c: (gst_matroska_mux_best_pad),
        (gst_matroska_mux_stream_is_vorbis_header),
        (gst_matroska_mux_write_data):
          Don't misinterpret GST_CLOCK_TIME_NONE as very high timestamp
          value and then dead-lock when muxing vorbis audio streams
          (the three vorbis header buffers carry no timestamp, and it
          would try to mux these after all video buffers). Fixes #340346.

          Improve clustering: start a new cluster also whenever we get
          a keyframe.

Comment 3 Tim-Philipp Müller 2006-05-03 16:27:20 UTC
Hrm, so apparently this broke 'make check'. Investigating ..
Comment 4 Tim-Philipp Müller 2006-05-03 18:21:48 UTC
Created attachment 64765 [details] [review]
force new clusters only on VIDEO keyframes; don't feed NULL codec_ids to strcmp()


This should fix 'make check' again.

 * the segfault was caused by feeding a NULL string to strcmp(). Not really
   sure WHY track->codec_id is NULL here, but protecting against it is
   worthwhile in any case. I attribute it to the test setup ;)

 * the data size assertion failure was caused by the clustering changes. We
   forced starting a new cluster whenever the buffer doesn't have the
   DELTA_UNIT flag set. We really want to do this only for _video_ buffers
   though, not for audio buffers.
Comment 5 Tim-Philipp Müller 2006-05-03 18:42:38 UTC
2006-05-03  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/matroska/matroska-mux.c:
        (gst_matroska_mux_stream_is_vorbis_header),
        (gst_matroska_mux_write_data):
          Don't strcmp() NULL strings.
          Only start new clusters on video keyframes, not on any
          random audio buffer that doesn't have the DELTA_UNIT
          flag set (fixes 'make check' again).