aiffparse: keep end_offset when seeking

After seeking in aiff files the information about the data end offset is
discarded, leading to audio artifacts with metadata chunks at the end of
a file.
This patch retains the end offset information after a seek event.

https://bugzilla.gnome.org//show_bug.cgi?id=769376
This commit is contained in:
Bernhard Miller 2016-08-01 11:45:30 +02:00 committed by Tim-Philipp Müller
parent f991e09319
commit 9171fa9c19

View file

@ -1933,6 +1933,15 @@ gst_aiff_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
aiff->start_segment = gst_event_new_segment (&segment);
/* If the seek is within the same SSND chunk and there is no new
* end_offset defined keep the previous end_offset. This will avoid noise
* at the end of playback if e.g. a metadata chunk is located at the end
* of the file. */
if (aiff->end_offset > 0 && offset < aiff->end_offset &&
offset >= aiff->datastart && end_offset == -1) {
end_offset = aiff->end_offset;
}
/* stream leftover data in current segment */
if (aiff->state == AIFF_PARSE_DATA)
gst_aiff_parse_flush_data (aiff);