oggdemux: fix artifacts at chain boundaries
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 29 May 2017 12:44:01 +0000 (13:44 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 29 May 2017 15:22:04 +0000 (16:22 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=782132

ext/ogg/gstoggdemux.c
ext/ogg/gstoggstream.c

index 6825f89..db3138c 100644 (file)
@@ -791,8 +791,9 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
 
   if (pad->map.audio_clipping && (clip_start || clip_end)) {
     GST_DEBUG_OBJECT (pad,
-        "Adding audio clipping %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT,
-        clip_start, clip_end);
+        "Clipping %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT " (%"
+        G_GUINT64_FORMAT " / %" G_GUINT64_FORMAT ")", clip_start, clip_end,
+        clip_start + clip_end, duration);
     gst_buffer_add_audio_clipping_meta (buf, GST_FORMAT_DEFAULT, clip_start,
         clip_end);
   }
@@ -4244,7 +4245,8 @@ gst_ogg_demux_read_end_chain (GstOggDemux * ogg, GstOggChain * chain)
     chain->segment_stop = GST_CLOCK_TIME_NONE;
   }
 
-  GST_INFO ("segment stop %" G_GUINT64_FORMAT, chain->segment_stop);
+  GST_INFO ("segment stop %" G_GUINT64_FORMAT ", for last granule %"
+      G_GUINT64_FORMAT, chain->segment_stop, last_granule);
 
   return GST_FLOW_OK;
 }
index 042f102..4ace481 100644 (file)
@@ -2033,10 +2033,7 @@ granulepos_to_granule_opus (GstOggStream * pad, gint64 granulepos)
   if (pad->first_granpos < 0 || granulepos < pad->first_granpos)
     pad->first_granpos = granulepos;
 
-  if (granulepos < -pad->granule_offset)
-    return 0;
-
-  return granulepos + pad->granule_offset;
+  return granulepos;
 }
 
 static gint64