Ticket #550: movenc.c.diff
| File movenc.c.diff, 1.5 KB (added by , 15 years ago) |
|---|
-
movenc.c
old new (this hunk was shorter than expected) 20 20 * License along with FFmpeg; if not, write to the Free Software 21 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 22 */ 23 //------------------------------------------------------Modifications History 24 // DATE DESCRIPTION 25 // 02/17/2011 Fixed handling of no data AMR frames 23 26 24 27 #include "movenc.h" 25 28 #include "avformat.h" 26 29 … … 1873 1967 1874 1968 if (enc->codec_id == CODEC_ID_AMR_NB) { 1875 1969 /* We must find out how many AMR blocks there are in one packet */ 1876 static uint16_t packed_size[16] = 1877 {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 0}; 1970 1971 // This array holds the number of data bytes used for each amr mode. 1972 static const uint8_t packed_size[16] = 1973 {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0}; 1878 1974 int len = 0; 1879 1975 1880 while (len < size && samplesInChunk < 100) { 1881 len += packed_size[(pkt->data[len] >> 3) & 0x0F]; 1976 while (len < size && samplesInChunk < 100) 1977 { 1978 // The first byte is a TOC byte that contains the AMR mode 1979 // We add 1 here for the TOC byte 1980 len += packed_size[(pkt->data[len] >> 3) & 0x0F] + 1; 1882 1981 samplesInChunk++; 1883 1982 } 1983 1884 1984 if(samplesInChunk > 1){ 1885 1985 av_log(s, AV_LOG_ERROR, "fatal error, input is not a single packet, implement a AVParser for it\n"); 1886 1986 return -1;
