filesrc: only update buffer size on short read

This commit is contained in:
Wim Taymans 2012-03-15 00:25:50 +01:00
parent 69e3639c96
commit c93cde0a30

View file

@ -369,7 +369,8 @@ gst_file_src_fill (GstBaseSrc * basesrc, guint64 offset, guint length,
}
gst_buffer_unmap (buf, &info);
gst_buffer_resize (buf, 0, bytes_read);
if (bytes_read != length)
gst_buffer_resize (buf, 0, bytes_read);
GST_BUFFER_OFFSET (buf) = offset;
GST_BUFFER_OFFSET_END (buf) = offset + bytes_read;