summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Miller <bernhard.miller@streamunlimited.com>2016-08-01 11:45:30 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-08-16 16:43:08 +0300
commitecf5fce04a9e745e1acb77033c4a2bedae6498f2 (patch)
treed805597dbe6acb31c528d94a1ba2aad7ac1a6a3e
parentd8719fae14cf5e24359f5ff9e140229a0710daaf (diff)
downloadgstreamer-plugins-bad-ecf5fce04a9e745e1acb77033c4a2bedae6498f2.tar.gz
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
-rw-r--r--gst/aiff/aiffparse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/aiff/aiffparse.c b/gst/aiff/aiffparse.c
index 5600a7eb8..aba4f0f35 100644
--- a/gst/aiff/aiffparse.c
+++ b/gst/aiff/aiffparse.c
@@ -1906,6 +1906,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);