diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-05-22 17:15:04 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-05-22 17:15:04 +0400 |
commit | eff913c9725b6578eb4b1fd2bf869bf01e4cf388 (patch) | |
tree | e0db4ddebcb7fc4ecccfbb0b8f5f80fb9c5f5b5c /libavformat/pcmdec.c | |
parent | f932e5f7169282daaa06b08500d2c632cf70e14e (diff) |
Autodetect Asterisk raw pcm with extension "sln".
Diffstat (limited to 'libavformat/pcmdec.c')
-rw-r--r-- | libavformat/pcmdec.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c index f4264d91c3..2584c33c24 100644 --- a/libavformat/pcmdec.c +++ b/libavformat/pcmdec.c @@ -144,3 +144,29 @@ PCMDEF(alaw, "PCM A-law", PCMDEF(mulaw, "PCM mu-law", "ul", AV_CODEC_ID_PCM_MULAW) + +static const AVOption sln_options[] = { + { "sample_rate", "", offsetof(PCMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 8000}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, + { "channels", "", offsetof(PCMAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, + { NULL }, +}; + +static const AVClass sln_demuxer_class = { + .class_name = "sln demuxer", + .item_name = av_default_item_name, + .option = sln_options, + .version = LIBAVUTIL_VERSION_INT, +}; + +AVInputFormat ff_sln_demuxer = { + .name = "sln", + .long_name = NULL_IF_CONFIG_SMALL("Asterisk raw pcm"), + .priv_data_size = sizeof(PCMAudioDemuxerContext), + .read_header = pcm_read_header, + .read_packet = ff_pcm_read_packet, + .read_seek = ff_pcm_read_seek, + .flags = AVFMT_GENERIC_INDEX, + .extensions = "sln", + .raw_codec_id = AV_CODEC_ID_PCM_S16LE, + .priv_class = &sln_demuxer_class, +}; |