GNOME Bugzilla – Bug 582779
[resindvd] Add support for other audio codecs than ac3
Last modified: 2009-09-26 15:25:46 UTC
Hi, attached patch adds support for other audio codecs than ac3. This doesn't work optimally yet as autoconvert for example drops all events before a child is added and other things... but it's a start :)
Created attachment 134710 [details] [review] resindvd-audio-codecs.diff
Do you have any idea of how to not lose events before a setcaps in autoconvert ?
(In reply to comment #2) > Do you have any idea of how to not lose events before a setcaps in autoconvert > ? Cache them in a list and send them to the child after it was added... that should work, I'll test that tomorrow :)
This doesn't seem to work and only makes things worse...
Awesome. How do you mean?
(In reply to comment #5) > Awesome. How do you mean? Without event caching in autoconvert resindvd doesn't play (gets stuck at position 0) but this can be fixed by seeking. With event caching it stays at 0 and it's impossible to seek :)
An important thing that needs doing is to unmask the 'other' stream formats in resindvdsrc.c by disabling this code in rsn_dvdsrc_prepare_streamsinfo_event: #if 1 /* FIXME: Only output A52 streams for now, until the decoder switching * is ready */ if (a->audio_format != 0) { GST_DEBUG_OBJECT (src, "Ignoring non-A52 stream %d, format %d", i, (int) a->audio_format); continue; } #endif
Created attachment 135868 [details] [review] Build a list of available audio decoder elements in rsnaudiodec Updated patch attached that iterates the registry to build the list of available decoder elements for the caps we need and sorts it by rank. We still need event caching until the first decoder is installed in autoconvert, and also for autoconvert to push segment info into the decoder elements when switching them in, but this is great progress.
autoconvert now caches the events and sends them downstream properly. commit cb1f2f2294befa4b1117e89bbfdf7f85e06b3ee4 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sun Aug 9 15:20:48 2009 +0200 autoconvert: Cache events and send them downstream once an element was selec Unfortunately this doesn't automatically make everything work as expected... with updated autoconvert and the patch from comment #8 everything deadlocks on pad blocks inside the stream selector. Any ideas? :)
There are two problems here: When running in playbin2 the above patch will always result in a deadlock by pad blocks in the playbin2 inputselector pads. When using the resin-play script everything works as expected... unless pads are ignored because no decoder is available. For example if no ac3 decoder is available and the current dvd track only contains ac3 audio tracks.
Ok, after the following commits everything works again with resin-play and totem at least (without Jan's patch) After applying Jan's patch resin-play still works but totem doesn't. commit 07f95364764f405d96e6d9b7ad422c4ff87404cf Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Fri Sep 25 11:04:01 2009 +0200 rsnstreamselector: Use new single object iterator for the internally linked This prevents an ugly deadlock. commit a9e05725d2150caab599f5689af89b013022849b Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Fri Sep 25 10:50:31 2009 +0200 resindvdbin: Don't block the external ghost pads but only their targets
...and this time the problem seems to be the pad blocking in playbin2 on the selector pads. At least that's where the important threads are waiting. Maybe playbin2 can't cope with resindvdbin adding it's 3 pads from different threads or with resindvdbin unblocking every pad directly after adding it (instead of unblocking them all at once after no-more-pads was signaled). decodebin2 does exactly that (adding pads all at once, signalling no-more-pads and only then unblock them all). I'll try that soon.
Ok, so this should be fixed now in latest GIT. At least it works as good as with the hardcoded audio decoder for me now commit 1de6d9d4187333373a0bed70babdfef1eed5c063 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Sep 26 17:23:02 2009 +0200 resindvdbin: Use gst_caps_can_intersect() because it's faster commit 13150af04a529cce56ac8c58a24239de8492a75a Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Sep 26 17:21:35 2009 +0200 rsnaudiodec: Use ghost pads and always forward application/x-gst-dvd events Fixes bug #582779. commit 434e604096c645372830ce9ca8764a5895b6754d Author: Jan Schmidt <thaytan@noraisin.net> Date: Sat Sep 26 17:19:32 2009 +0200 resindvdbin: Use autoconvert in rsnaudiodec and build a list of possible dec Partially fixes bug #582779.