GNOME Bugzilla – Bug 153657
make typefind prevent unneeded discont element
Last modified: 2004-12-22 21:47:04 UTC
2004-09-24 Ronald S. Bultje <rbultje@ronald.bitfreak.net> * gst/elements/gsttypefindelement.c: (stop_typefinding), (gst_type_find_element_handle_event), (gst_type_find_element_chain): * gst/elements/gsttypefindelement.h: Prevent output of discont events after typefinding. Typefind will seek until the position of its internal bufferstore size and then act as an identity. However, filesrc, gnomevfssrc or any other seekable element will send a discont before this, and this breaks a surprising amount of elements (including, but not limited to, avidemux, asfdemux and matroskademux). This patch makes typefind filter out this discont event. Has been tested with both seekable and non-seekable elements and has the correct behaviour in both cases. Also fixes the mentioned demuxers in pipelines with typefind.
Created attachment 31914 [details] [review] patch as described above
Avidemux (and sometimes matroskademux) experiences hangs after this patch; on the other hand, asfdemux, matroskademux and qtdemux are all fixed and several media files that failed previously in a player now work fine. I'd suggest to wait before applying this patch (i.e. not 0.8.6). There's probably something small wrong in it.
Created attachment 31933 [details] [review] revision This revises the sending of buffers downstream. The first patch would send the first buffer and then wait for the discont to come in. This is a race condition, because, while we are waiting for this event, a downstream element might seek further. This caused the hangs in avidemux and matroskademux. This revision delays the sending of the first data until the discont has arrived. This fixes the hangs in avidemux and matroskademux.
So, I'll try again, this patch doesn't fail any testcase that I can think of anymore, I'd like this in 0.8.6...
This was applied to the 0.8.5.3 release, we can now close this.