Closed Bug 591719 Opened 14 years ago Closed 14 years ago

sa_stream_get_position reports positions in non-sorted order

Categories

(Core :: Audio/Video, defect)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: yury, Assigned: yury)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8
Build Identifier: 

The underline libsydney for ALSA (Linux) might reports positions in out of order sequence, which might affect decoder state machine behavior and results of the IDOMMediaElement's currentTime property. See http://mxr.mozilla.org/mozilla-central/source/media/libsydneyaudio/src/sydney_audio_alsa.c#276 : 

  if (state == SND_PCM_STATE_RUNNING) {
    if (snd_pcm_delay(s->output_unit, &delay) != 0) {
      return SA_ERROR_SYSTEM;
    }
  } else {
    delay = 0;
  }
  ...
  *pos = s->bytes_written;
  if (*pos >= snd_pcm_frames_to_bytes(s->output_unit, delay)) {
    *pos -= snd_pcm_frames_to_bytes(s->output_unit, delay);

At the beginning state != SND_PCM_STATE_RUNNING and that makes delay = 0. After audio stream starts playback and the position jumps back quarter of a second.

Reproducible: Sometimes
Attachment #470246 - Flags: review?(kinetik)
Comment on attachment 470246 [details] [diff] [review]
Stores last good position to maintain the order

Thanks for the patch!
Attachment #470246 - Flags: review?(kinetik) → review+
Status: UNCONFIRMED → NEW
blocking2.0: --- → ?
Ever confirmed: true
Assignee: nobody → async.processingjs
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/48dec3f80d50
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: