filesrc: return any remaining data on EOS before returning FLOW_UNEXPECTED

This commit is contained in:
Tim-Philipp Müller 2011-12-25 12:39:49 +00:00
parent cf5de908fb
commit 8a932dbca6

View file

@ -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;