diff options
author | Martin Storsjö <martin@martin.st> | 2011-02-09 12:13:32 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2011-03-21 21:31:33 +0100 |
commit | 2890cba8b50cc8c6656bc5f5cd0ebb5fd80fb5e4 (patch) | |
tree | 6a0a6c0ac3ea5915b5966c0ab11ad67e783a621c /libavformat/amr.c | |
parent | 895678f8239213db1d074a39653fcd78bdf87c25 (diff) | |
download | ffmpeg-streaming-2890cba8b50cc8c6656bc5f5cd0ebb5fd80fb5e4.zip ffmpeg-streaming-2890cba8b50cc8c6656bc5f5cd0ebb5fd80fb5e4.tar.gz |
amr: Set the codec->bit_rate field based on the last packet
This allows libavformat to guess an estimated duration for
amr files.
For streams with varying bit rates (or with silence descriptors
or "no frame" blocks) the guess is, of course, inaccurate.
Diffstat (limited to 'libavformat/amr.c')
-rw-r--r-- | libavformat/amr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/amr.c b/libavformat/amr.c index ba2ed4f..f2fecf3 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -153,6 +153,9 @@ 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->data[0]=toc; |