summaryrefslogtreecommitdiff
path: root/libavformat/isom.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/isom.h')
-rw-r--r--libavformat/isom.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 8cc5ab744d..2a7486d7ba 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -239,8 +239,21 @@ void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id);
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb);
-enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries);
+/**
+ * Compute codec id for 'lpcm' tag.
+ * See CoreAudioTypes and AudioStreamBasicDescription at Apple.
+ */
+static inline enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
+{
+ /* lpcm flags:
+ * 0x1 = float
+ * 0x2 = big-endian
+ * 0x4 = signed
+ */
+ return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0);
+}
+
#endif /* AVFORMAT_ISOM_H */