{
gint64 keyindex, keyoffset;
- if (pad->granuleshift != 0) {
+ if (pad->granuleshift != 0 && pad->granuleshift != -1) {
keyindex = granulepos >> pad->granuleshift;
keyoffset = granulepos - (keyindex << pad->granuleshift);
return keyindex + keyoffset;
{
gint64 keyoffset;
- if (pad->granuleshift != 0) {
+ if (pad->granuleshift != 0 && pad->granuleshift != -1) {
/* If we don't know where the previous keyframe is yet, assume it is
at 0 or 1, depending on bitstream version. If nothing else, this
avoids getting negative granpos back. */