diff options
author | Michael Niedermayer | 2011-03-23 02:42:56 +0100 |
---|---|---|
committer | Michael Niedermayer | 2011-03-23 02:42:56 +0100 |
commit | 4fa0e24736bff7d7fbdfb36ed578a1db166817d4 (patch) | |
tree | 3e74e32f82b02ff498320e07424d330473f44fd3 /libavformat/amr.c | |
parent | 4952afff75bc60df9c842bc248f1da8fe57e04a6 (diff) | |
parent | ee26abf2a4884bb56959bac8215758195776c553 (diff) |
Merge remote-tracking branch 'newdev/master'
* newdev/master: (33 commits)
Fix an infinite loop when RoQ encoded generated a frame with a size greater than the maximum valid size.
Add kbdwin.o to AC3 decoder
Detect byte-swapped AC-3 and support decoding it directly.
cosmetics: indentation
Always copy input data for AC3 decoder.
ac3enc: make sym_quant() branch-free
cosmetics: indentation
Add a CPU flag for the Atom processor.
id3v2: skip broken tags with invalid size
id3v2: don't explicitly skip padding
Make sure kbhit() is in conio.h
fate: update wmv8-drm reference
vc1: make P-frame deblock filter bit-exact.
configure: Add the -D parameter to the dlltool command
amr: Set the AVFMT_GENERIC_INDEX flag
amr: Set the pkt->pos field properly to the start of the packet
amr: Set the codec->bit_rate field based on the last packet
rtsp: Specify unicast for TCP interleaved streams, too
Set the correct target for mingw64 dlltool
applehttp: Change the variable for stream position in seconds into int64_t
...
Conflicts:
ffmpeg.c
ffplay.c
libavcodec/ac3dec.c
libavformat/avio.h
libavformat/id3v2.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/amr.c')
-rw-r--r-- | libavformat/amr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/amr.c b/libavformat/amr.c index 0459632b10..66763f3fa7 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -121,6 +121,7 @@ static int amr_read_packet(AVFormatContext *s, { AVCodecContext *enc = s->streams[0]->codec; int read, size = 0, toc, mode; + int64_t pos = avio_tell(s->pb); if (url_feof(s->pb)) { @@ -153,8 +154,11 @@ static int amr_read_packet(AVFormatContext *s, return AVERROR(EIO); } + /* Both AMR formats have 50 frames per second */ + s->streams[0]->codec->bit_rate = size*8*50; + pkt->stream_index = 0; - pkt->pos= avio_tell(s->pb); + pkt->pos = pos; pkt->data[0]=toc; pkt->duration= enc->codec_id == CODEC_ID_AMR_NB ? 160 : 320; read = avio_read(s->pb, pkt->data+1, size-1); @@ -177,6 +181,7 @@ AVInputFormat ff_amr_demuxer = { amr_read_header, amr_read_packet, NULL, + .flags = AVFMT_GENERIC_INDEX, }; #endif |