Commit Graph

112 Commits

Author SHA1 Message Date
Matthew Hoops
d2bf7f99fd AUDIO: Really fix seeking with audio edits
I really have no idea what I was thinking in acb127c2
2014-08-14 20:16:14 -04:00
Eugene Sandulenko
6e794a9823 Merge pull request #487 from clone2727/audio_fixes
AUDIO: Miscellaneous AudioStream fixes
2014-08-09 15:33:50 +02:00
Joni Vähämäki
1d12bddd63 AUDIO: Rename MP3Stream's _totalTime to _curTime to better reflect the variable's purpose. 2014-08-01 01:43:04 +03:00
Matthew Hoops
1b834f92bd AUDIO: Finish off AAC/QDM2 queues when done decoding a packet 2014-07-27 23:44:44 -04:00
Joni Vähämäki
8564c7ec0a AUDIO: Increment total play time when decoding MP3 data. 2014-07-26 14:30:56 +03:00
Matthew Hoops
9630753861 COMMON: Move some QuickTime Track variables into SampleDesc where they belong 2014-03-18 19:12:20 -04:00
Johannes Schickel
452cec49d9 AUDIO: Make GPL headers consistent in themselves. 2014-02-18 02:39:32 +01:00
D G Turner
ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00:00
Matthew Hoops
72101c66fa AUDIO: Cleanup naming 2013-04-20 15:18:09 -04:00
Matthew Hoops
c38beb0ced AUDIO: Remove default makeADPCMStream rate/channels values 2013-04-20 14:54:41 -04:00
Matthew Hoops
54d4707edc AUDIO: Fix invalid free call 2013-04-16 12:05:42 -04:00
clone2727
91317c3630 Merge pull request #293 from clone2727/qtmidi
Add support for QuickTime Music playback
2012-12-13 15:49:40 -08:00
D G Turner
62d87e30f4 AUDIO: Fix MS ADPCM to work with Mono streams using odd sized buffers. 2012-12-10 16:29:16 +00:00
Matthew Hoops
3399b5662f AUDIO: Fix AIFF comment about supporting IMA ADPCM 2012-11-24 17:25:39 -05:00
Matthew Hoops
f0091af6b5 AUDIO: Don't allow skipping negative times in skipSamples() 2012-10-03 10:45:43 -04:00
Johannes Schickel
89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Matthew Hoops
4a458236f6 COMMON: Make QuickTimeParser::readSampleDesc take the desc size 2012-09-09 13:47:40 -04:00
Matthew Hoops
2f9b1b67b0 ALL: Mark off some things as used by Pegasus 2012-08-31 22:26:02 -04:00
Matthew Hoops
857b92f8ff Merge pull request #268 from clone2727/video-rewrite
VideoDecoder upgrade & partial rewrite
2012-08-26 15:41:56 -04:00
Matthew Hoops
813689d68c AUDIO: Move LimitingAudioStream to audio/ 2012-08-12 00:08:13 -04:00
Johannes Schickel
84426c6355 AUDIO: Fix "if" formatting in QDM2 code. 2012-08-09 03:25:14 +02:00
D G Turner
43e2c6ee1e AUDIO: Correct ADPCM Fixes to ensure internal buffers are drained.
This also adds an omitted _decodedSampleCount initialization in Oki
ADPCM decoder.
2012-08-04 20:29:37 +01:00
D G Turner
9c47fdae29 AUDIO: Fix Oki ADPCM to work with Mono streams using odd sized buffers. 2012-08-04 18:38:12 +01:00
D G Turner
b79221729b AUDIO: Fix DVI ADPCM to work with Mono streams using odd sized buffers. 2012-08-04 18:36:13 +01:00
Johannes Schickel
9c14f4419b AUDIO: Make VOC decoder a bit more failsafe by still playing parts of invalid VOC files.
Formerly when an unsupported block was found the opening would fail. Instead
now all the valid blocks till that occasion will be played.

This fixes an missing sound in Full Throttle (thanks to clone2727 for
reporting), which is using a VOC file which fails to specify the proper block
length for its sound block.
2012-06-11 20:37:04 +02:00
Matthew Hoops
a3832ecd5d AUDIO: Fix seeking to the end of a QuickTime audio track 2012-05-21 22:38:32 -04:00
Matthew Hoops
acb127c2d2 AUDIO: Fix seeking in QuickTime files with multiple edit lists 2012-04-28 15:22:42 -04:00
D G Turner
8a5b08341e AUDIO: Remove now unused Sin/Cos table and FFT code from QDM2 Codec.
This was only used by the RDFT code, now replaced by Common::RDFT.
2012-04-13 07:37:31 +01:00
D G Turner
7f930dfae3 AUDIO: Migrate QDM2 Codec to using Common::RDFT class. 2012-04-13 07:37:30 +01:00
D G Turner
ce1f805212 AUDIO: Fixes to restore QDM2 Codec function.
The Bitstream format is changed to 32LELSB and an error in the getVlc2()
function bitstream reading needed to be corrected to fix operation.
2012-04-13 07:37:29 +01:00
D G Turner
50a9c6429d AUDIO: Update to QDM2 codec fixing pointer to stream buffer usage.
This should allow the QDM2 codec to work again with Common::Bitstream
instead of the older getBits() reader, but this aborts with a reading
past end of stream error...
2012-04-13 07:37:28 +01:00
D G Turner
b5f5cbe5fa AUDIO: Removed qdm2_decode_sub_packet_header() function from QDM2.
This is to allow modification of the code which needs to assign the
data member of the sub_packet structure to an offset in the input
byte readStream.
2012-04-13 07:37:27 +01:00
D G Turner
845812f12e AUDIO: Fix skipping in QDM2 BitStream usage.
getBits(n) would cause a runtime error if n is greater than 32,
but using getBits() to skip is no longer necessary as the newer
BitStream class has a skip method, which is used instead.
2012-04-13 07:37:26 +01:00
D G Turner
220f60fd60 AUDIO: Clean up QDM2 getVlc2() function. 2012-04-13 07:37:25 +01:00
D G Turner
fa44707028 AUDIO: Initial Refactoring of QDM2 to use Common::BitStream.
This removes the internal getBitContext bitwise reading code and
replaces with Common::BitStream.

However, this breaks the codec as in one location, the internal buffer
of getBitContext reader is used and this can't be directly replaced.
This will need to be understood and rewritten.
2012-04-13 07:37:24 +01:00
Matthew Hoops
3e47203d64 AUDIO: Force QuickTime stereo samples to mono if needed
The number of channels in AAC can differ from the actual number of channels needed making us require this. The channel count inside the container is always the correct one.
2012-04-10 16:44:41 -04:00
Matthew Hoops
68e1a04183 AUDIO: Fix QDM2 extra data parsing 2012-03-30 14:40:14 -04:00
Matthew Hoops
be8c557645 AUDIO: Add support for multiple QuickTime audio tracks
This also cleans up the QuickTime audio code to make it a bit more manageable too
2012-03-19 12:04:46 -04:00
Tarek Soliman
a4798602d7 JANITORIAL: Fix missing whitespace in pointer cast
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g'

This seems to have caught some params as well which is not undesirable IMO.
It also caught some strings containing this which is undesirable so I
excluded them manually. (engines/sci/engine/kernel_tables.h)
2012-02-15 10:07:10 -06:00
Bastien Bouclet
577635acf2 AUDIO: Add support for RAW PCM wave stream with an incomplete packet
The last incomplete packet is ignored
2012-02-09 16:10:50 +01:00
Johannes Schickel
86a4bbbd9b AUDIO: Add more warnings in case invalid VOC data is encountered. 2012-01-26 02:43:58 +01:00
Johannes Schickel
d620dd90bd AUDIO: Fix missing sounds in Simon 1 Amiga CD32.
It seems the VOC files used by Simon 1 Amiga CD32 use 128 as terminator block.
Added this as a special case with a debug output when it's caught.
2012-01-26 02:36:51 +01:00
Johannes Schickel
b89e63798a AUDIO: Remove outdated comment about RawStream. Thanks to clone2727 for noticing. 2011-12-31 06:29:56 +01:00
Matthew Hoops
df88a1f2a7 AUDIO: Fix M4A seeking with multiple time->sample chunks 2011-12-29 14:50:05 -05:00
Matthew Hoops
5b1095a400 AUDIO: Only warn about audio edit lists when the count is > 1
MPEG-4 files don't contain any elst atom
2011-12-29 12:47:53 -05:00
Johannes Schickel
c6599ea5ee AUDIO: Remove obsolete loadVOCFromStream. 2011-12-24 18:23:47 +01:00
Matthew Hoops
42bb9a2264 AUDIO: SAGA now uses the Mac snd code too 2011-12-24 11:09:54 -05:00
Matthew Hoops
b367772b5f VIDEO: Add support for QuickTime video track edit lists 2011-12-12 12:28:48 -05:00
Matthew Hoops
6bbff58314 VIDEO: Rewrite VMD audio streaming
Audio is now decoded in AudioStream classes instead of being decoded ahead of time and then queued.
2011-11-27 15:52:05 +01:00
Johannes Schickel
dd42278373 AUDIO: Fix type 9 sound blocks in VOC code.
This should fix missing sound in Touche.
2011-11-24 22:55:25 +01:00