For the case when ptime sample requests > than the DlbBuffer is.
Actually normal rates (e.g. PCMA/PCMU) have 20ms (ca. 160bytes),
even if the ptime would be 100ms, which is unusual, the size
requested per sample would be ca 1600bytes.
`AmAudio::samples` are `DblBuffer` based,
which has size of `AUDIO_BUFFER_SIZE * 2`, but it's not
contiguous, but exposes only half of it at a time through
the `unsigned char*` overloading operator.
Add the main guard in `AmAudio::get()`, who calculates the actual size
to be requested from the buffer to read into.
Additionally (actually less effective) prevent also overflow
in the implementation itself in `AmAudioFile::read()`, this is where
the `fread()` happens. Just for the case if the path towards it
is different in any other case.
Change-Id: Ifd381f4435f0a16ecee5612da41ea9046f6d22a4
Add missing initialisers and fix order.
In some cases the member was actually unused and could just be removed.
Change-Id: I0f0c927eb8271c35dcfd371f225847f62bea2812
Warned-by: Coverity
AmAudioFile f;
f.open("/tmp/record.wav|A-Law")
The subtypes are defined in the codec modules, currently:
- for wav:
Pcm16, A-Law, Mu-Law
- for ilbc:
iLBC30, iLBC20
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1350 8eb893ce-cfd4-0310-b710-fb5ebe64c474
o added codec module init/destroy functions
o fixed re-creating codec instance on file open
o added unlimited data_size option on RO files
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@708 8eb893ce-cfd4-0310-b710-fb5ebe64c474