diff options
author | Seungha Yang <seungha@centricular.com> | 2020-09-16 03:13:09 +0900 |
---|---|---|
committer | Seungha Yang <seungha@centricular.com> | 2020-09-16 03:13:09 +0900 |
commit | 72933810f5dcd0e5ca401d2f3bfe3c2a638fb5c4 (patch) | |
tree | 38a7346e5ffdf812a5788c9ab5d50d9d5c3d4682 | |
parent | 7388b14423391a0701363cabaff86c19c2301cf1 (diff) | |
download | gst-libav-72933810f5dcd0e5ca401d2f3bfe3c2a638fb5c4.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/90>
-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 d9eb178..b21c231 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -1824,6 +1824,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; |