summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-09-28 20:34:11 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-09-28 20:34:11 +0000
commitd663a1fdc0fd405aafabc9bca6d19d02ca640df9 (patch)
tree7b8bbe5e7c61c935111aa68aec37fdd441e1327c /libavformat/mov.c
parentcd1f22f97e9cec9a64c41f33dfd9658c73461270 (diff)
AMR-WB support by (Johannes Carlsson <joca at rixmail dot se>)
Originally committed as revision 2311 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c42
1 files changed, 14 insertions, 28 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index fb7019c2c1..970d101427 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -121,6 +121,7 @@ static const CodecTag mov_audio_tags[] = {
{ CODEC_ID_AAC, MKTAG('m', 'p', '4', 'a') }, /* MPEG 4 AAC or audio ? */
/* The standard for mpeg4 audio is still not normalised AFAIK anyway */
{ CODEC_ID_AMR_NB, MKTAG('s', 'a', 'm', 'r') }, /* AMR-NB 3gp */
+ { CODEC_ID_AMR_WB, MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */
{ CODEC_ID_NONE, 0 },
};
@@ -850,10 +851,10 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
#endif
} else {
st->codec.codec_id = codec_get_id(mov_audio_tags, format);
- if(st->codec.codec_id==CODEC_ID_AMR_NB) //from TS26.244
+ if(st->codec.codec_id==CODEC_ID_AMR_NB || st->codec.codec_id==CODEC_ID_AMR_WB) //from TS26.244
{
#ifdef DEBUG
- printf("AMR-NB audio identified!!\n");
+ printf("AMR-NB or AMR-WB audio identified!!\n");
#endif
get_be32(pb);get_be32(pb); //Reserved_8
get_be16(pb);//Reserved_2
@@ -863,41 +864,26 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
get_be16(pb);//Reserved_2
//AMRSpecificBox.(10 bytes)
-
-#ifdef DEBUG
- int damr_size=
-#endif
+
get_be32(pb); //size
-#ifdef DEBUG
- int damr_type=
-#endif
get_be32(pb); //type=='damr'
-#ifdef DEBUG
- int damr_vendor=
-#endif
get_be32(pb); //vendor
get_byte(pb); //decoder version
get_be16(pb); //mode_set
get_byte(pb); //mode_change_period
get_byte(pb); //frames_per_sample
-#ifdef DEBUG
- printf("Audio: damr_type=%c%c%c%c damr_size=%d damr_vendor=%c%c%c%c\n",
- (damr_type >> 24) & 0xff,
- (damr_type >> 16) & 0xff,
- (damr_type >> 8) & 0xff,
- (damr_type >> 0) & 0xff,
- damr_size,
- (damr_vendor >> 24) & 0xff,
- (damr_vendor >> 16) & 0xff,
- (damr_vendor >> 8) & 0xff,
- (damr_vendor >> 0) & 0xff
- );
-#endif
-
st->duration = AV_NOPTS_VALUE;//Not possible to get from this info, must count number of AMR frames
- st->codec.sample_rate=8000;
- st->codec.channels=1;
+ if(st->codec.codec_id==CODEC_ID_AMR_NB)
+ {
+ st->codec.sample_rate=8000;
+ st->codec.channels=1;
+ }
+ else //AMR-WB
+ {
+ st->codec.sample_rate=16000;
+ st->codec.channels=1;
+ }
st->codec.bits_per_sample=16;
st->codec.bit_rate=0; /*It is not possible to tell this before we have
an audio frame and even then every frame can be different*/