aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-09-14 08:55:27 +0200
committerAnton Khirnov <anton@khirnov.net>2011-09-17 06:42:17 +0200
commitd906f49aa8f36fc173cfa96580cbe29e88be5049 (patch)
tree279d65b8e91ea13c9062faed193abbf14d1b923a /libavformat
parent3a78fb57de0b8ee800d91c69e395b685e285a63b (diff)
downloadffmpeg-d906f49aa8f36fc173cfa96580cbe29e88be5049.tar.gz
rawdec: g722 is always 1 channel/16kHz
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rawdec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index 76ab09c0e5..f0d487bd6f 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -51,9 +51,12 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->channels = 1;
- if (s1->sample_rate)
+ if (id == CODEC_ID_ADPCM_G722)
+ st->codec->sample_rate = 16000;
+
+ if (s1 && s1->sample_rate)
st->codec->sample_rate = s1->sample_rate;
- if (s1->channels)
+ if (s1 && s1->channels)
st->codec->channels = s1->channels;
st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
@@ -199,13 +202,11 @@ const AVClass ff_rawvideo_demuxer_class = {
AVInputFormat ff_g722_demuxer = {
.name = "g722",
.long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
- .priv_data_size = sizeof(RawAudioDemuxerContext),
.read_header = ff_raw_read_header,
.read_packet = ff_raw_read_partial_packet,
.flags= AVFMT_GENERIC_INDEX,
.extensions = "g722,722",
.value = CODEC_ID_ADPCM_G722,
- .priv_class = &ff_rawaudio_demuxer_class,
};
#endif