gst-plugins-base: videodecoder: drain current segment upon new one to ensure correct flow return
Jan Schmidt
thaytan at noraisin.net
Sun Feb 22 05:38:35 PST 2015
Hi,
We've been discussing in
https://bugzilla.gnome.org/show_bug.cgi?id=734617 that despite what the
docs say, finish() isn't usable on some implementations (Android, OMX),
which can't actually handle new data after finish().
Also, you left some cruft in your commit. #if 1/#endif.
J.
On 22/02/15 23:27, Mark Nauwelaerts wrote:
> Module: gst-plugins-base
> Branch: master
> Commit: cc1b4eaf9ebe4568f9c2c64338cef1b2edbdca3f
> URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=cc1b4eaf9ebe4568f9c2c64338cef1b2edbdca3f
>
> Author: Mark Nauwelaerts <mnauw at users.sourceforge.net>
> Date: Sat Feb 21 17:42:08 2015 +0100
>
> videodecoder: drain current segment upon new one to ensure correct flow return
>
> See also https://bugzilla.gnome.org/show_bug.cgi?id=709224
>
> ---
>
> gst-libs/gst/video/gstvideodecoder.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
> index f4b4136..c7e637d 100644
> --- a/gst-libs/gst/video/gstvideodecoder.c
> +++ b/gst-libs/gst/video/gstvideodecoder.c
> @@ -1123,6 +1123,16 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder,
> {
> GstSegment segment;
>
> + /* need to drain here because:
> + * - done in case of GAP and this is no less invasive
> + * - upstream now thinks in terms of a new segment so it will get
> + * confused if remaining data of the old segment is delay decoded, then
> + * dropped with EOS return due to clipping
> + * - it is said in @finish documentation subclass should expect this upon
> + * end of a segment and be able to handle this
> + */
> + gst_video_decoder_drain_out (decoder, TRUE);
> +
> gst_event_copy_segment (event, &segment);
>
> if (segment.format == GST_FORMAT_TIME) {
> @@ -2829,12 +2839,14 @@ gst_video_decoder_clip_and_push_buf (GstVideoDecoder * decoder, GstBuffer * buf)
> GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
> GST_TIME_ARGS (segment->start),
> GST_TIME_ARGS (segment->stop), GST_TIME_ARGS (segment->time));
> +#if 1
> if (segment->rate >= 0) {
> if (GST_BUFFER_PTS (buf) >= segment->stop)
> ret = GST_FLOW_EOS;
> } else if (GST_BUFFER_PTS (buf) < segment->start) {
> ret = GST_FLOW_EOS;
> }
> +#endif
> gst_buffer_unref (buf);
> goto done;
> }
>
> _______________________________________________
> gstreamer-commits mailing list
> gstreamer-commits at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits
>
More information about the gstreamer-devel
mailing list