[FFmpeg-cvslog] avformat/nistshperedec: add support for mu-law as sample-byte-format
Paul B Mahol
git at videolan.org
Fri Apr 8 23:47:34 CEST 2016
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Apr 8 22:26:08 2016 +0200| [a4790e1890a1e4a659c24e50c2e1a9beab51a2a9] | committer: Paul B Mahol
avformat/nistshperedec: add support for mu-law as sample-byte-format
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a4790e1890a1e4a659c24e50c2e1a9beab51a2a9
---
libavformat/nistspheredec.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavformat/nistspheredec.c b/libavformat/nistspheredec.c
index 542bcd1..359d9e3 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;
More information about the ffmpeg-cvslog
mailing list