Closed Bug 616292 Opened 14 years ago Closed 6 years ago

Don't play Vorbis samples with a negative granulepos

Categories

(Core :: Audio/Video: Playback, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: cpearce, Unassigned)

Details

Attachments

(1 file)

From the Vorbis spec
http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-130000A.2

<quote>
The granule (PCM) position of the first page need not indicate that the stream started at position zero. Although the granule position belongs to the last completed packet on the page and a valid granule position must be positive, by inference it may indicate that the PCM position of the beginning of audio is positive or negative.

   * A positive starting value simply indicates that this stream begins at some positive time offset, potentially within a larger program. This is a common case when connecting to the middle of broadcast stream.
   * A negative value indicates that output samples preceeding time zero should be discarded during decoding; this technique is used to allow sample-granularity editing of the stream start time of already-encoded Vorbis streams. The number of samples to be discarded must not exceed the overlap-add span of the first two audio packets.
</quote>

So the first vorbis page can report in its granulepos that it contains fewer samples than it actually does, and those extra samples should not be played or contribute to timestamp calculation. Currently we do this in Firefox, we should not. This means our timestamps (and thus A/V sync) will be (probably only slightly) out.
The granulepos of the last page can also indicate that trailing samples need to be discarded, and this requires knowledge of the granulepos of the preceding page as well to implement correctly.
Assignee: cpearce → nobody
Component: Audio/Video → Audio/Video: Playback
Mass closing do to inactivity.
Feel free to re-open if still needed.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: