diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-10-13 00:21:38 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-10-13 00:21:38 +0400 |
commit | fd54f700720a0fed7432a2b3741989d9bff09d99 (patch) | |
tree | fb864d533b28ddcfea364d6e9d75f30098f3a1bf /libavformat/avr.c | |
parent | cfc9a4c732af2985d31a861bc1a11169a4d71509 (diff) |
avformat/avr: use ff_get_pcm_codec_id()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/avr.c')
-rw-r--r-- | libavformat/avr.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libavformat/avr.c b/libavformat/avr.c index e03f1a46f7..02edf451a8 100644 --- a/libavformat/avr.c +++ b/libavformat/avr.c @@ -69,16 +69,9 @@ static int avr_read_header(AVFormatContext *s) avio_skip(s->pb, 20); avio_skip(s->pb, 64); - if (!sign && bps == 8) { - st->codec->codec_id = AV_CODEC_ID_PCM_U8; - } else if (!sign && bps == 16) { - st->codec->codec_id = AV_CODEC_ID_PCM_U16BE; - } else if (sign == 0xFFFFu && bps == 8) { - st->codec->codec_id = AV_CODEC_ID_PCM_S8; - } else if (sign == 0xFFFFu && bps == 16) { - st->codec->codec_id = AV_CODEC_ID_PCM_S16BE; - } else { - avpriv_request_sample(s, "bits per sample %d", bps); + st->codec->codec_id = ff_get_pcm_codec_id(bps, 0, 1, sign); + if (st->codec->codec_id == AV_CODEC_ID_NONE) { + avpriv_request_sample(s, "Bps %d and sign %d", bps, sign); return AVERROR_PATCHWELCOME; } |