Lines Matching refs:position

174 printf("  error seeking to position: %lld (%lld)\n", pos,
298 // copies /frames/ frames at position /position/ from the source to the
304 int64 position, int64 frames) const
309 source = (char*)source + frameSize * (position - sourceOffset);
310 target = (char*)target + frameSize * (position - targetOffset);
317 // copies /frames/ frames at position /position/ from the source to the
323 int64 position, int64 frames) const
325 _CopyFrames(buffer->data, buffer->offset, target, targetOffset, position,
425 // In case there already exists a buffer that starts at position this
430 MediaTrackAudioSupplier::_FindUsableBufferFor(int64 position) const
432 Buffer* buffer = _FindBufferAtFrame(position);
443 MediaTrackAudioSupplier::_GetBuffersFor(BList& buffers, int64 position,
450 int32 startFrame = max(position, buffer->offset);
451 int32 endFrame = min(position + frames, buffer->offset + buffer->size);
468 // Read a buffer from the current position (which is supplied in /position/)
471 MediaTrackAudioSupplier::_ReadBuffer(Buffer* buffer, int64 position)
473 return _ReadBuffer(buffer, position, system_time());
478 // Read a buffer from the current position (which is supplied in /position/)
481 MediaTrackAudioSupplier::_ReadBuffer(Buffer* buffer, int64 position,
489 buffer->offset = position;
499 // buffer pointer as well as position and number of frames are adjusted
542 /*! Reads /frames/ frames from /position/ into /buffer/. The frames are not
548 MediaTrackAudioSupplier::_ReadUncachedFrames(void* buffer, int64 position,
553 // seek to the position
554 int64 currentPos = position;
557 TRACE("_ReadUncachedFrames() - seeked to position: %lld\n", currentPos);
558 // if (position - currentPos > 100000)
560 // "keyframe was far away: %lld -> %lld\n", position, currentPos);
568 "position: %lld/%lld\n", cacheBuffer, currentPos, position);
571 int64 size = min(position + frames,
572 cacheBuffer->offset + cacheBuffer->size) - position;
574 _CopyFrames(cacheBuffer, buffer, position, position, size);
576 position += size;
594 // Check, if data at this position are cache.
617 MediaTrackAudioSupplier::_FindKeyFrameForward(int64& position)
622 &position, B_MEDIA_SEEK_CLOSEST_FORWARD);
625 position += framesPerBuffer - 1;
626 position = position % framesPerBuffer;
633 MediaTrackAudioSupplier::_FindKeyFrameBackward(int64& position)
638 &position, B_MEDIA_SEEK_CLOSEST_BACKWARD);
640 position -= position % _FramesPerBuffer();
647 MediaTrackAudioSupplier::_SeekToKeyFrameForward(int64& position)
649 if (position == fMediaTrack->CurrentFrame())
655 int64 oldPosition = position;
657 error = fMediaTrack->SeekToFrame(&position,
660 "%lld -> %lld (%lld)\n", oldPosition, position,
663 _FindKeyFrameForward(position);
664 error = fMediaTrack->SeekToFrame(&position);
672 MediaTrackAudioSupplier::_SeekToKeyFrameBackward(int64& position)
675 if (position == currentPosition)
680 int64 wantedPosition = position;
681 error = fMediaTrack->FindKeyFrameForFrame(&position,
683 if (error == B_OK && currentPosition > position
685 // The current position is before the wanted position,
687 position = currentPosition;
690 if (error == B_OK && position > wantedPosition) {
697 error = fMediaTrack->SeekToFrame(&position, 0);
699 position = fMediaTrack->CurrentFrame();
702 "- %s\n", wantedPosition, position,
710 _FindKeyFrameBackward(position);
711 error = fMediaTrack->SeekToFrame(&position);