From a4790e1890a1e4a659c24e50c2e1a9beab51a2a9 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 8 Apr 2016 22:26:08 +0200 Subject: [PATCH] avformat/nistshperedec: add support for mu-law as sample-byte-format Signed-off-by: Paul B Mahol --- libavformat/nistspheredec.c | 7 +++++-- 1 file 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;