videodecoder: In reverse playback mode we need to finish the subclass after passing...
authorSebastian Dröge <sebastian@centricular.com>
Thu, 27 Mar 2014 19:15:01 +0000 (20:15 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 29 Mar 2014 09:33:01 +0000 (10:33 +0100)
gst-libs/gst/video/gstvideodecoder.c

index 7855816..4745066 100644 (file)
@@ -960,16 +960,16 @@ gst_video_decoder_drain_out (GstVideoDecoder * dec, gboolean at_eos)
     if (!priv->packetized) {
       ret = gst_video_decoder_parse_available (dec, TRUE, FALSE);
     }
+
+    if (at_eos) {
+      if (decoder_class->finish)
+        ret = decoder_class->finish (dec);
+    }
   } else {
     /* Reverse playback mode */
     ret = gst_video_decoder_flush_parse (dec, TRUE);
   }
 
-  if (at_eos) {
-    if (decoder_class->finish)
-      ret = decoder_class->finish (dec);
-  }
-
   GST_VIDEO_DECODER_STREAM_UNLOCK (dec);
 
   return ret;
@@ -1986,6 +1986,18 @@ gst_video_decoder_flush_parse (GstVideoDecoder * dec, gboolean at_eos)
     walk = priv->parse_gather;
   }
 
+  /* We need to tell the subclass to drain now */
+  if (at_eos) {
+    GstVideoDecoderClass *decoder_class;
+
+    decoder_class = GST_VIDEO_DECODER_GET_CLASS (dec);
+    if (decoder_class->finish)
+      res = decoder_class->finish (dec);
+  }
+
+  if (res != GST_FLOW_OK)
+    goto done;
+
   /* now send queued data downstream */
   walk = priv->output_queued;
   while (walk) {