mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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.
This commit is contained in:
parent
895678f823
commit
2890cba8b5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user