1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
Commit graph

482 commits

Author SHA1 Message Date
Allofich
42402976e3 Fixes for building in MSVC 2017-06-13 19:38:12 +09:00
Bret Curtis
d785344fad purge all instances of <boost/shared_ptr.hpp>, clean up unused headers 2017-06-09 19:08:53 +02:00
Bret Curtis
07f75e1104 replace boost::shared_ptr in extern and components 2017-06-09 19:08:53 +02:00
Ewan Higgs
38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 2017-06-09 16:49:25 +02:00
MiroslavR
d24bcbac15 Do not apply underwater effects to player's voice (Fixes #3850) 2017-04-30 18:51:49 +02:00
scrawl
5a939418fc Add missing avcodec_close (Fixes #3741) 2017-02-06 15:49:13 +01:00
Jules Blok
e9d8ff532f OpenAL_Output: When a source is finished, rewind it instead of stopping it.
This works around a bug in the MacOS OpenAL implementation.
2016-12-29 01:03:13 +01:00
MiroslavR
c34d85ffc2 Implement water sounds (Closes #451) 2016-11-28 21:34:58 +01:00
scrawl
530fb61ad0 Use OpenThreads instead of boost thread
This should allow OpenMW to work better with git versions of openscenegraph. OSG dev version 3.5.5 added the setting of thread affinity for the main thread. The problem is that in the boost/standard threading libraries, the affinity of a thread is inherited by any further threads launched from that thread, leading to these threads always running on the same core as the main thread unless you tell them not to.

With OpenThreads, the default affinity of a thread is none, no matter what parent thread it was launched from.

So, when using custom threading with OSG 3.6+, we have these options:
1. explicitely tell OSG to *not* set the thread affinity
or 2. explicitely set the thread affinity of additional threads created (possible with boost, but not possible with std::thread)
or 3. use OpenThreads
or 4. accept the suboptimal performance of non-OSG threads (in OpenMW's case the sound streaming & video threads) running on the same core as the main thread

This patch opts for 3.)

Reference: http://forum.openscenegraph.org/viewtopic.php?t=16158
2016-10-10 18:23:06 +02:00
scrawl
509e5dfe4d Include cleanup 2016-06-27 22:10:30 +02:00
scrawl
4699a8098b Include fix 2016-06-27 21:51:18 +02:00
scrawl
1739351b7a Remove now unused Sound_Decoder::rewind() 2016-06-27 21:38:04 +02:00
scrawl
dc1b010cf0 Don't analyze the loudness for sounds that don't need it 2016-06-27 21:37:13 +02:00
scrawl
965aaebbdb Analyze the loudness data as the stream is decoded for playback
Instead of getting the loudness data for the whole file in advance, we now get it piece by piece as the sound is streamed.

The benefit is that we need to decode the audio just once instead of twice.

We no longer need to rewind() the stream when the first decoding is done, this should hopefully fix bug #3453 .
2016-06-27 21:32:54 +02:00
scrawl
dfc2f3469a Don't play music if no playlist is set 2016-06-07 01:36:09 +02:00
scrawl
90a99991d1 Use empty() instead of !size() 2016-02-22 19:06:12 +01:00
scrawl
604b5d24e9 Use a ConstPtr in SoundManager 2015-12-18 18:11:30 +01:00
scrawl
4553db7b43 Merge pull request #861 from scrawl/soundcrash
Fix crash when running out of sound sources
2015-12-15 18:23:03 +01:00
scrawl
6a749e77f2 Fix crash when running out of sound sources 2015-12-15 15:12:48 +01:00
Chris Robinson
cddea4a99c Start underwater sound after updating sounds
In between the startUpdate/finishUpdate calls, changes are deferred so that
they can happen all at once. This includes starting sounds, so when the
underwater sound is started it will be immediately checked to see if it's
playing. Since it's not yet playing, it'll be seen as stopped and get cleaned
up before ever playing.
2015-12-14 14:05:01 -08:00
Chris Robinson
f47f0a996f Stop the object's old say sound before playing the new one 2015-12-11 15:49:45 -08:00
Chris Robinson
7fc2df153a Rename stopSound/stopStream to finishSound/finishStream
Since they're also used to clean up output resources, not just stopping.
2015-12-11 15:13:14 -08:00
Chris Robinson
808f701013 Use the actor's Head position for Say streams 2015-12-10 17:48:45 -08:00
Chris Robinson
a00a4bce77 Avoid some unnecessary indirection 2015-12-10 16:33:27 -08:00
scrawl
1264651af7 Fix coverity defects 2015-12-08 21:12:05 +01:00
scrawl
e69750905a Fix gcc warning about function casts 2015-12-08 16:51:50 +01:00
Chris Robinson
c75303b652 Add an option to select and enable HRTF 2015-12-05 17:14:53 -08:00
scrawl
53158d29b1 stopSound crash fix 2015-12-05 01:54:16 +01:00
Marc Zinnschlag
e0c9265148 Merge remote-tracking branch 'origin/master' 2015-12-03 15:56:24 +01:00
scrawl
86881bcf39 In first person mode, attach sound listener to the camera 2015-12-03 15:16:20 +01:00
Chris Robinson
f19f1c47c8 Fix playing pending voices without a Ptr 2015-12-02 16:09:25 -08:00
Chris Robinson
2face3d0a9 Combine duplicate code 2015-12-02 16:09:25 -08:00
Chris Robinson
1407366e51 Use a premade SoundStream object for the output's streamSound functions 2015-12-02 16:09:25 -08:00
Chris Robinson
2ee3265b66 Use a premade Sound object for the output's playSound functions 2015-12-02 16:09:25 -08:00
Chris Robinson
53718a5ca0 Use a typedef for the sound instance handle 2015-12-02 16:09:25 -08:00
Chris Robinson
3a39a92b93 Keep track of audio tracks 2015-12-02 16:09:24 -08:00
Chris Robinson
2883cdba5c Initialize the Sound object before modifying the pitch variable 2015-12-02 16:09:24 -08:00
Chris Robinson
a6db96b2d8 Update sound and stream parameters 2015-12-02 16:09:24 -08:00
Chris Robinson
4bd235284b Rename a couple members to avoid confusion 2015-12-02 16:09:24 -08:00
Chris Robinson
1ce3e7f5b9 Use a separate type for streams
They're basically the same, but it's to help avoid accidents with passing non-
streaming sounds to the stream functions, or vice-versa.
2015-12-02 16:09:24 -08:00
Chris Robinson
816015d6e6 Avoid inheriting from Sound for sound types 2015-12-02 16:09:24 -08:00
Alexander "Ace" Olofsson
24340bff95 Add a space 2015-11-30 17:47:36 +01:00
Alexander "Ace" Olofsson
6823298516 Different way to solve the type deduction issue 2015-11-30 17:42:25 +01:00
Alexander "Ace" Olofsson
a69e751089 Revert "Fix windows builds"
This reverts commit b085c09f86.
2015-11-30 17:38:46 +01:00
Alexander "Ace" Olofsson
b085c09f86 Fix windows builds
Can't instantiate a container (at least with MSVC) without knowing the exact size of the object being stored, forward-declares only work with pointers.
I couldn't see a simple way to remove the forward declare, so pointers and memory management it is.
2015-11-30 13:36:15 +01:00
Chris Robinson
4ee409af84 Load loudness data asynchronously
Currently abuses the output audio streams' background processing thread to do
the work, since there's no generalized threaded processing mechanism.
2015-11-27 09:47:14 -08:00
Chris Robinson
0f05ccf72a Use a non-recursive mutex and properly end the streaming thrread 2015-11-27 08:13:23 -08:00
Chris Robinson
b5ed2e65f8 Add a method to get the sound stream delay
This helps avoid a lock during the movie player's read method, since it needs
to sync with the current playback position which would otherwise need to get
the movie decoder's current position.
2015-11-27 06:01:50 -08:00
Chris Robinson
f3c035907c Rename Sound::update to Sound::applyUpdates 2015-11-27 04:55:17 -08:00
Chris Robinson
9568aa6a84 Use a condition variable to wake up the audio stream thread
This should make starting streams a bit more responsive, and allows us to do
more in it that really shouldn't wait for its next wake up.
2015-11-27 04:30:09 -08:00