OSDN Git Service
(root)
/
coroid
/
libav_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
895678f
)
amr: Set the codec->bit_rate field based on the last packet
author
Martin Storsjö
<martin@martin.st>
Wed, 9 Feb 2011 10:13:32 +0000
(12:13 +0200)
committer
Luca Barbato
<lu_zero@gentoo.org>
Mon, 21 Mar 2011 20:31:33 +0000
(21:31 +0100)
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.
libavformat/amr.c
patch
|
blob
|
history
diff --git
a/libavformat/amr.c
b/libavformat/amr.c
index
ba2ed4f
..
f2fecf3
100644
(file)
--- 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;