mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
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:
parent
f991e09319
commit
9171fa9c19
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue