summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-04-08 22:26:08 +0200
committerPaul B Mahol <onemda@gmail.com>2016-04-08 22:34:38 +0200
commita4790e1890a1e4a659c24e50c2e1a9beab51a2a9 (patch)
treea382b3d7cf13598ff948d5a5f23134860af754e6 /libavformat
parent966d43d7786d1a95162e3feff1d5bfbcb58e571f (diff)
avformat/nistshperedec: add support for mu-law as sample-byte-format
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/nistspheredec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/nistspheredec.c b/libavformat/nistspheredec.c
index 542bcd1adb..359d9e38a5 100644
--- a/libavformat/nistspheredec.c
+++ b/libavformat/nistspheredec.c
@@ -62,8 +62,9 @@ static int nist_read_header(AVFormatContext *s)
st->codec->bits_per_coded_sample = bps << 3;
if (!av_strcasecmp(coding, "pcm")) {
- st->codec->codec_id = ff_get_pcm_codec_id(st->codec->bits_per_coded_sample,
- 0, be, 0xFFFF);
+ if (st->codec->codec_id == AV_CODEC_ID_NONE)
+ st->codec->codec_id = ff_get_pcm_codec_id(st->codec->bits_per_coded_sample,
+ 0, be, 0xFFFF);
} else if (!av_strcasecmp(coding, "alaw")) {
st->codec->codec_id = AV_CODEC_ID_PCM_ALAW;
} else if (!av_strcasecmp(coding, "ulaw") ||
@@ -96,6 +97,8 @@ static int nist_read_header(AVFormatContext *s)
be = 0;
} else if (!av_strcasecmp(format, "10")) {
be = 1;
+ } else if (!av_strcasecmp(format, "mu-law")) {
+ st->codec->codec_id = AV_CODEC_ID_PCM_MULAW;
} else if (av_strcasecmp(format, "1")) {
avpriv_request_sample(s, "sample byte format %s", format);
return AVERROR_PATCHWELCOME;