blender/extern/audaspace
Sergey Sharybin 68a76c3c77 Fix #121719: Sound does not play when playback starts outside of strip
The issue was caused by an integer overflow in the `FFMPEGReader::seek`, which
lead to different results depending on an exact compiler version and platform.

The overflow happened in the equation which calculates `m_position`, in its
`packet.pts - st_time` part, which is effectively `int64_t - uint64_t` which is
expected to result in `uint64_t` due to the way how upcasting works in C++.

With the values `packet.pts=0` and `st_time=353600` from the test file the
calculation resulted in a negative value, which then wrapped around due to the
unsigned nature of the type, resulting in very big value on arm64. The value
was wrong, but it did not manifest itself as an error, since the seek code
believed it found the place.

However, when built on x86 platform, the result value was very large negative
value. It is possible that the type upcasting went different, due to the
multiplication with a double value later in the formula. And this large negative
value lead to the seeking code to read the entire file, trying to make it so
the `m_position` is not less than the requested position.

Fortunately, the `AVStream::start_time` is `int64_t`, which leads to a simple
fix which avoids signed/unsigned cast, making the seeking code to properly
calculate `m_position` on both arm64 and x64 platforms, regardless of the
compiler.

Pull Request: https://projects.blender.org/blender/blender/pulls/122149
2024-05-23 21:25:04 +02:00
..
bindings Extern: update Audaspace to latest version 2024-02-29 12:08:00 +01:00
config
include Audaspace: porting bugfixes for CoreAudioDevice from upstream. 2024-05-06 08:28:20 +02:00
plugins Fix #121719: Sound does not play when playback starts outside of strip 2024-05-23 21:25:04 +02:00
src Audaspace: porting bugfixes for CoreAudioDevice from upstream. 2024-05-06 08:28:20 +02:00
AUTHORS Audaspace: porting changes from upstream. 2023-05-25 23:00:22 +02:00
blender_config.cmake Build: forward SDL defines to audaspace 2024-03-01 16:14:47 +11:00
CHANGES Audaspace: porting changes from upstream. 2023-04-08 10:36:40 +02:00
CMakeLists.txt Audaspace: porting changes from upstream. 2024-03-05 18:22:17 +01:00
INSTALL Audaspace: porting changes from upstream. 2023-04-08 10:36:40 +02:00
LICENSE
README.blender Extern: update Audaspace to latest version 2024-02-29 12:08:00 +01:00
README.md Audaspace: porting changes from upstream. 2023-04-08 10:36:40 +02:00

audaspace

Audaspace (pronounced "outer space") is a high level audio library written in C++ with language bindings for Python for example. It started out as the audio engine of the 3D modelling application Blender and is now released as a standalone library.

Documentation and Community

The documentation including guides for building and installing, demos, tutorials as well as the API reference for C++, C and python can be found on https://audaspace.github.io.

Bug reports and feature requests should go to the issue tracker.

For any other discussions about audaspace there is a mailing list and there is also the IRC channel #audaspace on irc.freenode.net.

Features

The following (probably incomplete) features are supported by audaspace:

  • input/output devices
  • input from microphones, line in, etc.
  • output devices including 3D audio support
  • file reading/writing
  • filters like low-/highpass and effects like delay, reverse or fading
  • generators for simple waveforms like silence, sine and triangle
  • respecification - this term is used for changing stream parameters which are
  • channel count - channel remapping
  • sample format - the library internally uses 32 bit floats
  • sample rate - resampling
  • simple (superposition, joining and ping-pong aka forward-reverse) and more complex (non-linear audio editing) sequencing of sounds

License

Copyright © 2009-2023 Jörg Müller. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.