From 8a932dbca6c07cf04c37bb720382d5afbe6791c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 25 Dec 2011 12:39:49 +0000 Subject: [PATCH] filesrc: return any remaining data on EOS before returning FLOW_UNEXPECTED --- plugins/elements/gstfilesrc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 9844f0d..87402c8 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -836,8 +836,12 @@ gst_file_src_create_read (GstFileSrc * src, guint64 offset, guint length, } /* files should eos if they read 0 and more was requested */ - if (G_UNLIKELY (ret == 0)) + if (G_UNLIKELY (ret == 0)) { + /* .. but first we should return any remaining data */ + if (bytes_read > 0) + break; goto eos; + } to_read -= ret; bytes_read += ret; -- 2.7.4