gstreamer/gst-libs/gst
George Kiagiadakis a4d97f49e2 videodecoder: In reverse playback, flush the output queue after decoding each keyframe chain
This fixes the reverse playback scenario when upstream is not fully
parsing the stream and does not send every keyframe chain separately
with the DISCONT flag on the keyframe.

To explain this, let's suppose we have this stream:
 0 1 2 3 4 5 6 7 8
 K     K     K

In most circumstances, the upstream parser will chain in the
decoder the buffers in the following order:

 6 7 8 3 4 5 0 1 2
 D     D     D

In this case, GstVideoDecoder will flush the parse queue every time
it receives discont (D) and we will eventually get in the output queue:

  (flush here) 8 7 6  (flush here) 5 4 3 (flush here) 2 1 0

In case the upstream parser doesn't do this work, though,
GstVideoDecoder will receive the whole stream at once and will flush
the parse queue afterwards:

 0 1 2 3 4 5 6 7 8
 D

During the flush, it will look backwards for keyframes and will
decode in this order:

 6 7 8 3 4 5 0 1 2

This is the same order that it would receive from upstream if
upstream was parsing and looking for the keyframes, only that now
there is no flushing of the output queue in between keyframes,
which will result in the output queue looking like this:

 2 1 0 6 5 3 8 7 6

This will confuse downstream obviously and will play incorrectly.
This patch forces the decoder to flush the output queue every time
it picks a new keyframe to decode, so it will end up decoding 6 7 8
and then flushing before picking 3 for decoding, so the output will
get 8 7 6 before 6 5 3 and the video will play back correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=734441
2014-08-11 10:22:55 +02:00
..
allocators dmabuf: Ensure _get_fd() works even for shared memory 2014-07-11 09:47:04 +02:00
app appsrc: Some minor fixes and cleanup 2014-08-06 10:07:42 +02:00
audio audioencoder: Mark caps argument as not being transferred 2014-08-10 10:45:14 +01:00
fft fft: Fix compiler errors caused by not including config.h 2013-03-02 19:13:39 +01:00
pbutils pbutils: discoverer: Always set the pipeline back to NULL after an error 2014-07-30 15:28:21 +02:00
riff riff: Print invalid fourcc in error message in hex 2014-07-03 19:37:18 +02:00
rtp rtpbasepayload: Implement reconfigure event & renegotiation without subclass 2014-05-03 10:21:04 +02:00
rtsp docs: Assorted documentation and introspection fixes for new 1.4 API 2014-07-02 09:09:44 +02:00
sdp sdp: add gstmikey.h to sdp.h 2014-07-04 09:01:35 +01:00
tag libs: There is no G_TYPE_CHECK_INTERFACE_TYPE and G_TYPE_CHECK_INTERFACE_CAST 2014-06-26 16:18:46 +02:00
video videodecoder: In reverse playback, flush the output queue after decoding each keyframe chain 2014-08-11 10:22:55 +02:00
gettext.h Fix FSF address 2012-11-03 23:05:09 +00:00
glib-compat-private.h Fix FSF address 2012-11-03 23:05:09 +00:00
gst-i18n-app.h tools: add simple command-line gst-play utility for testing purposes 2013-08-16 15:45:23 +01:00
gst-i18n-plugin.h Fix FSF address 2012-11-03 23:05:09 +00:00
Makefile.am tools: add simple command-line gst-play utility for testing purposes 2013-08-16 15:45:23 +01:00