This is used by Vorbis for sample accurate clipping, but this is
deemed an invalid stream by the opus spec.
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);