[FFmpeg-devel] [PATCH]Fix mov AMR frame length for no data mode

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Oct 15 17:24:54 CEST 2011


Hi!

If I understand http://wiki.multimedia.cx/index.php?title=AMR-NB#Field_meaning 
and the comments in ticket #550 correctly, attached patch fixes writing of no 
data mode AMR frames in mov.

Analyzed by Igor Levin.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5fd54fc..1d5a96e 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2013,7 +2013,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
     if (enc->codec_id == CODEC_ID_AMR_NB) {
         /* We must find out how many AMR blocks there are in one packet */
         static uint16_t packed_size[16] =
-            {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 0};
+            {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1};
         int len = 0;
 
         while (len < size && samplesInChunk < 100) {


More information about the ffmpeg-devel mailing list