Hi, patch attached.
From 232f24be4ec3fbc1c4f6590c20eb433d8484d0ef Mon Sep 17 00:00:00 2001 From: Paul B Mahol <one...@gmail.com> Date: Wed, 6 Apr 2016 21:57:52 +0200 Subject: [PATCH] avformat: support shorten in nistshpere demuxer
Signed-off-by: Paul B Mahol <one...@gmail.com> --- libavcodec/shorten.c | 4 ++++ libavformat/nistspheredec.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index b27707a..9da04eb 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -387,6 +387,9 @@ static int read_header(ShortenContext *s) if (s->version > 1) s->lpcqoffset = V2LPCQOFFSET; + if (s->avctx->extradata_size > 0) + goto end; + if (get_ur_golomb_shorten(&s->gb, FNSIZE) != FN_VERBATIM) { av_log(s->avctx, AV_LOG_ERROR, "missing verbatim section at beginning of stream\n"); @@ -407,6 +410,7 @@ static int read_header(ShortenContext *s) if ((ret = decode_wave_header(s->avctx, s->header, s->header_size)) < 0) return ret; +end: s->cur_chan = 0; s->bitshift = 0; diff --git a/libavformat/nistspheredec.c b/libavformat/nistspheredec.c index 2f17f9e..e6ce9fd 100644 --- a/libavformat/nistspheredec.c +++ b/libavformat/nistspheredec.c @@ -67,8 +67,12 @@ static int nist_read_header(AVFormatContext *s) } else if (!av_strcasecmp(coding, "alaw")) { st->codec->codec_id = AV_CODEC_ID_PCM_ALAW; } else if (!av_strcasecmp(coding, "ulaw") || - !av_strcasecmp(coding, "mu-law")) { + !memcmp(coding, "mu-law", FFMIN(strlen(coding), 7))) { st->codec->codec_id = AV_CODEC_ID_PCM_MULAW; + } else if (!memcmp(coding, "pcm,embedded-shorten-2.00", FFMIN(strlen(coding), 26))) { + st->codec->codec_id = AV_CODEC_ID_SHORTEN; + if (ff_alloc_extradata(st->codec, 1)) + st->codec->extradata[0] = 1; } else { avpriv_request_sample(s, "coding %s", coding); } -- 2.5.0
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel