diff options
author | Seungha Yang <seungha@centricular.com> | 2020-09-16 03:13:09 +0900 |
---|---|---|
committer | Seungha Yang <seungha@centricular.com> | 2020-10-14 17:38:12 +0900 |
commit | 747a0fb72cb59d7060147ea20108421fe2a22300 (patch) | |
tree | 17310278b1ebf9c8e0fdc266536e41c7c0d6da50 | |
parent | de93710ef36f05fe427049d953cc807567e185fe (diff) | |
download | gst-libav-747a0fb72cb59d7060147ea20108421fe2a22300.tar.gz |
avviddec: Don't return GST_FLOW_EOS from drain()/finish()
AVERROR_EOF means that it's fully drained, but it doesn't
mean that that end of stream.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/94>
-rw-r--r-- | ext/libav/gstavviddec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index ac9af5b..957fee5 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -1754,6 +1754,14 @@ gst_ffmpegviddec_drain (GstVideoDecoder * decoder) } while (got_frame && ret == GST_FLOW_OK); avcodec_flush_buffers (ffmpegdec->context); + /* FFMpeg will return AVERROR_EOF if it's internal was fully drained + * then we are translating it to GST_FLOW_EOS. However, because this behavior + * is fullly internal stuff of this implementation and gstvideodecoer + * baseclass doesn't convert this GST_FLOW_EOS to GST_FLOW_OK, + * convert this flow retturn by ourselves */ + if (ret == GST_FLOW_EOS) + ret = GST_FLOW_OK; + done: return ret; |