oggdemux: reject opus streams with negative start time

This is used by Vorbis for sample accurate clipping, but this is
deemed an invalid stream by the opus spec.
This commit is contained in:
Vincent Penquerc'h 2012-06-06 17:42:36 +01:00
parent ba967d285a
commit e126073489

View file

@ -922,10 +922,16 @@ gst_ogg_pad_submit_packet (GstOggPad * pad, ogg_packet * packet)
return GST_FLOW_ERROR;
}
if (granule > pad->map.accumulated_granule)
if (granule >= pad->map.accumulated_granule)
start_granule = granule - pad->map.accumulated_granule;
else
start_granule = 0;
else {
if (pad->map.forbid_start_clamping) {
GST_ERROR_OBJECT (ogg, "Start of stream maps to negative time");
return GST_FLOW_ERROR;
} else {
start_granule = 0;
}
}
pad->start_time = gst_ogg_stream_granule_to_time (&pad->map,
start_granule);