Commit Graph

16 Commits

Author SHA1 Message Date
Michael Niedermayer
f55bc96a54 avcodec/pcm-dvd: reset last header on errors
Fixes: msan_uninit-mem_7f4fff975a2c_4957_dvd_audio_sample.aob
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-27 03:00:52 +01:00
Michael Niedermayer
918cab1a9f avcodec/pcm-dvd: print actual block size values in block size changed warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-18 21:00:03 +01:00
Michael Niedermayer
4adf1fe34f avcodec/pcm-dvd: fix incorrectly printed warning about changed block sizes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-18 21:00:03 +01:00
Michael Niedermayer
ab184b298d avcodec/pcm-dvd: fix 20/24bit 1 channel
Fixes part of ticket3122

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-18 21:00:03 +01:00
Michael Niedermayer
5db49fc38d avcodec/pcm-dvd: fix 20bit 2 channels
Fixes part of ticket3122

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-18 21:00:03 +01:00
Michael Niedermayer
fc477263fa Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pcm-dvd: Minor leftovers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-13 13:48:43 +02:00
Michael Niedermayer
3c89ec2816 Merge commit 'd9cdb7d8d6d828bb5497ea3f0fd7edd2f3f6cc30'
* commit 'd9cdb7d8d6d828bb5497ea3f0fd7edd2f3f6cc30':
  pcm-dvd: Support channel configuration changes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-13 13:43:13 +02:00
Christian Schmidt
aca25104ea pcm-dvd: Minor leftovers
Drop a pointless branch in uninit and use the compact copyright.
2013-09-13 12:14:05 +02:00
Christian Schmidt
d9cdb7d8d6 pcm-dvd: Support channel configuration changes
The sample buffering logic does not take into account that the blocksize
could change. Reset the buffer if the channel configuration changes,
since if there are leftover samples, it is most likely a broken or
misconcatenated stream. This could lead to negative numbers for
missing_samples during decoding.

Thanks to Michael Niedermeyer for pointing these out.
2013-09-13 12:14:05 +02:00
Paul B Mahol
5be7aecc80 pcm-dvd: use av_freep()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-09-01 19:20:39 +00:00
Paul B Mahol
fc435d977a pcm-dvd: remove redundant log message
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-09-01 19:19:31 +00:00
Michael Niedermayer
7c1805869d avcodec/pcm-dvd: discard buffer if block size changed
This prevents a potential crash

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-01 13:00:39 +02:00
Martin Storsjö
789cd1de99 pcm-dvd: Fix build on big endian
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-01 13:00:38 +02:00
Michael Niedermayer
cb4d05e7f2 Merge commit 'a42e3a6700547e4e49445bda81d3a89ec3e081a9'
* commit 'a42e3a6700547e4e49445bda81d3a89ec3e081a9':
  pcm_dvd: consolidate pieces from pcm.c and mpeg.c

Conflicts:
	libavcodec/pcm.c
	libavcodec/version.h
	libavformat/mpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-01 13:00:08 +02:00
Martin Storsjö
21ffd41011 pcm-dvd: Fix build on big endian
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-31 18:06:26 +02:00
Christian Schmidt
a42e3a6700 pcm_dvd: consolidate pieces from pcm.c and mpeg.c
Remove the header decoding for PCM audio from mpeg.c and the
20/24bit parts from pcm.c and merge them into a new decoder in
pcm-dvd.c.

The decoder has added support for samples that span multiple
packets and modified 20/24bit group decoding. Both is needed to
decode samples that have been generated with DVD-Lab Pro 2. The
decoding of 16bit PCM and two channel 24bit is identical to
before. No other samples are known to verify the correctness of
the encoding this software does.
The complete list of tested formats is
48kHz/16bit/2-8 channels
48kHz/24bit/2-5 channels
96kHz/16bit/2-4 channels
96kHz/24bit/2 channels

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-31 11:26:29 +02:00