audiodecoder: Don't be too picky about the output frame counter
authorSebastian Dröge <sebastian@centricular.com>
Fri, 20 Jun 2014 09:00:14 +0000 (11:00 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 20 Jun 2014 09:02:55 +0000 (11:02 +0200)
commit909dd7831b3f8e5b6a8c5d6e6b0efc346012408d
tree430af60be417cf649eb75885bd2f2dad0c6105a3
parent5ebfe5b26b6e404e663945fbd61ad7ca3f1a058b
audiodecoder: Don't be too picky about the output frame counter

With most decoder libraries, and especially when accessing codecs via
OpenMAX or similar APIs, we don't have the ability to properly related
the output buffers to a number of input samples. And could e.g. get
a fractional number of input buffers decoded at a time.

Previously this would in the end lead to an error message and stopped
playback. Change it to a warning message instead and try to handle it
gracefully. In theory the subclass can now get timestamp tracking
wrong if it completely misuses the API, but if on average it behaves
correct (and gst-omx and others do) it will continue to work properly.

Also add a test for the new behaviour.

We don't change it in the encoder yet as that requires more internal logic
changes AFAIU and I'm not aware of a case where this was a problem so far.
gst-libs/gst/audio/gstaudiodecoder.c
tests/check/libs/audiodecoder.c