aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2015-04-03 21:04:43 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-04-03 21:13:50 +0200
commit036079ce34311547be5940c5d856db5498fae029 (patch)
tree3d9f720377828d3a559f8d928ddf98f4b45d517b /libavformat
parentf8413f74a1847db161a3443b1740b2659cd48753 (diff)
downloadffmpeg-036079ce34311547be5940c5d856db5498fae029.tar.gz
lavf/mpeg: Support alaw in Hikvision CCTV recordings.
Fixes a sample from ticket #4182.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpeg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index dbe5f103f2..c29291db9f 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -547,6 +547,9 @@ redo:
codec_id = AV_CODEC_ID_ADPCM_ADX;
// Auto-detect AC-3
request_probe = 50;
+ } else if (m->imkh_cctv && startcode == 0x1c0) {
+ codec_id = AV_CODEC_ID_PCM_ALAW;
+ request_probe = 50;
} else {
codec_id = AV_CODEC_ID_MP2;
if (m->imkh_cctv)
@@ -593,7 +596,8 @@ skip:
st->id = startcode;
st->codec->codec_type = type;
st->codec->codec_id = codec_id;
- if (st->codec->codec_id == AV_CODEC_ID_PCM_MULAW) {
+ if ( st->codec->codec_id == AV_CODEC_ID_PCM_MULAW
+ || st->codec->codec_id == AV_CODEC_ID_PCM_ALAW) {
st->codec->channels = 1;
st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 8000;