[vlc-devel] [RFC PATCH 0/2] Decoder fallback (new question inside)

Thomas Guillem thomas at gllm.fr
Fri Apr 8 16:44:41 CEST 2016

I just rebased/fixed a very old set of patches:

I didn't fix issues addressed in this thread
https://mailman.videolan.org/pipermail/vlc-devel/2015-June/103220.html (Audio
output device live change is still not handled).

But I have one more problematic issue in mind:

When a decoder module fails, it releases the input block_t. Therefore the next
module won't decode this block, this can be very problematic if a failure
happens on a key frame.

Since the decoder module owns the input_block once pf_decode is called, we
can't reuse it after. To solve this issue, I see only 3 solutions (that I don't

 - Constify the block in pf_decode. Modules won't be able to modify or release
   it, the release will be done by input/decoder.c. Some modules will need to
   be heavily modified for that new behavior. Furthermore, it'll introduce a
   new memcpy for asynchronous modules.

 - Dup the input block before pf_decode. An extra malloc + mempcy for each
   input blocks is really bad. Maybe we can do that until the decoder outputted
   a first frame ?

 - Handle the fallback elsewhere. In case of decoder module failure, Seek at
   last good position, and try a new decoder module.

What do you think ?

Thomas Guillem (2):
  modules: add module_need_ignored
  decoder: fallback to a next module on error

 include/vlc_modules.h           |  8 +++++---
 modules/audio_output/mmdevice.c |  2 +-
 modules/audio_output/winstore.c |  2 +-
 modules/codec/avcodec/va.c      |  2 +-
 src/config/core.c               |  2 +-
 src/input/decoder.c             | 39 ++++++++++++++++++++++++++++++++++-----
 src/misc/messages.c             |  2 +-
 src/modules/bank.c              | 27 ++++++++++++++++++++++-----
 src/modules/modules.c           | 13 +++++++++++--
 src/modules/modules.h           |  2 +-
 src/network/tls.c               |  4 ++--
 src/video_output/window.c       |  2 +-
 12 files changed, 81 insertions(+), 24 deletions(-)


More information about the vlc-devel mailing list