aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-29 13:58:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-29 14:00:44 +0100
commitd7b20bfbb582c369518c73720fb4b0266714cde6 (patch)
tree27dfaa2c3e2f273e661555336b6ed6d6b9eb9e5e /libavformat/mov.c
parent076300bf8b43d5d56a91cd2ad845d596969c87cf (diff)
parent5c7bf2dddee5bdfa247ff0d57cb8a37d19077f66 (diff)
downloadffmpeg-d7b20bfbb582c369518c73720fb4b0266714cde6.tar.gz
Merge commit '5c7bf2dddee5bdfa247ff0d57cb8a37d19077f66'
* commit '5c7bf2dddee5bdfa247ff0d57cb8a37d19077f66': lavf: move nuv fourcc audio tags from riff to nuv lavf: add a common function for selecting a pcm codec from parameters Conflicts: libavformat/internal.h libavformat/mov.c libavformat/riff.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c33
1 files changed, 6 insertions, 27 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1a8a5a7182..149bd20954 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1170,33 +1170,12 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
*/
enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
{
- if (flags & 1) { // floating point
- if (flags & 2) { // big endian
- if (bps == 32) return AV_CODEC_ID_PCM_F32BE;
- else if (bps == 64) return AV_CODEC_ID_PCM_F64BE;
- } else {
- if (bps == 32) return AV_CODEC_ID_PCM_F32LE;
- else if (bps == 64) return AV_CODEC_ID_PCM_F64LE;
- }
- } else {
- if (flags & 2) {
- if (bps == 8) {
- // signed integer
- if (flags & 4) return AV_CODEC_ID_PCM_S8;
- else return AV_CODEC_ID_PCM_U8;
- }else if (bps == 16) return AV_CODEC_ID_PCM_S16BE;
- else if (bps == 24) return AV_CODEC_ID_PCM_S24BE;
- else if (bps == 32) return AV_CODEC_ID_PCM_S32BE;
- } else {
- if (bps == 8) {
- if (flags & 4) return AV_CODEC_ID_PCM_S8;
- else return AV_CODEC_ID_PCM_U8;
- }else if (bps == 16) return AV_CODEC_ID_PCM_S16LE;
- else if (bps == 24) return AV_CODEC_ID_PCM_S24LE;
- else if (bps == 32) return AV_CODEC_ID_PCM_S32LE;
- }
- }
- return AV_CODEC_ID_NONE;
+ /* lpcm flags:
+ * 0x1 = float
+ * 0x2 = big-endian
+ * 0x4 = signed
+ */
+ return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0);
}
int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)