aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2005-09-02 19:16:48 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2005-09-02 19:16:48 +0000
commitb461b3bc4a14fe86aba4ed8e9adf30ab262896a2 (patch)
tree6ebc879c0917029608f33b2a224cb9a85c7ed3b4 /libavformat/utils.c
parent16beae15f3b610dfaa1d39d1effa25816c4185ae (diff)
downloadffmpeg-b461b3bc4a14fe86aba4ed8e9adf30ab262896a2.tar.gz
Support de-/encoding of 24 and 32 bit PCM (from and to internal 16 bit).
Originally committed as revision 4548 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index eb19eea527..7dede05b49 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -643,6 +643,23 @@ static int get_audio_frame_size(AVCodecContext *enc, int size)
/* specific hack for pcm codecs because no frame size is
provided */
switch(enc->codec_id) {
+ case CODEC_ID_PCM_S32LE:
+ case CODEC_ID_PCM_S32BE:
+ case CODEC_ID_PCM_U32LE:
+ case CODEC_ID_PCM_U32BE:
+ if (enc->channels == 0)
+ return -1;
+ frame_size = size / (4 * enc->channels);
+ break;
+ case CODEC_ID_PCM_S24LE:
+ case CODEC_ID_PCM_S24BE:
+ case CODEC_ID_PCM_U24LE:
+ case CODEC_ID_PCM_U24BE:
+ case CODEC_ID_PCM_S24DAUD:
+ if (enc->channels == 0)
+ return -1;
+ frame_size = size / (3 * enc->channels);
+ break;
case CODEC_ID_PCM_S16LE:
case CODEC_ID_PCM_S16BE:
case CODEC_ID_PCM_U16LE: