plugins/elements/gstfilesrc.c: Correctly generate EOS for non-seekable files. We don't have a total length for them a...

Original commit message from CVS:
Patch by: Michal Benes <michal dot benes at itonis dot tv>
* plugins/elements/gstfilesrc.c: (gst_file_src_create_read):
Correctly generate EOS for non-seekable files. We don't have a total
length for them and would get an unexpected end of file if we only
special-cased for regular files. (Fixes: #404569)
This commit is contained in:
Michal Benes 2007-02-05 13:15:44 +00:00 committed by Sebastian Dröge
parent e8f48c03f4
commit 475df740ec
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2007-02-05 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: Michal Benes <michal dot benes at itonis dot tv>
* plugins/elements/gstfilesrc.c: (gst_file_src_create_read):
Correctly generate EOS for non-seekable files. We don't have a total
length for them and would get an unexpected end of file if we only
special-cased for regular files. (Fixes: #404569)
2007-02-05 Sebastian Dröge <slomo@circular-chaos.org>
* tests/check/elements/filesrc.c: (GST_START_TEST),

View file

@ -788,8 +788,8 @@ gst_file_src_create_read (GstFileSrc * src, guint64 offset, guint length,
if (G_UNLIKELY (ret < 0))
goto could_not_read;
/* regular files should have given us what we expected */
if (G_UNLIKELY ((guint) ret < length && src->is_regular))
/* seekable regular files should have given us what we expected */
if (G_UNLIKELY ((guint) ret < length && src->seekable))
goto unexpected_eos;
/* other files should eos if they read 0 and more was requested */