#3634 closed defect (fixed)
asfenc: too many payloads in a packet
Reported by: | Aaron Graham | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | asf |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description (last modified by )
In the ASF specification:
http://www.microsoft.com/en-us/download/details.aspx?id=14995
the section on Multiple payloads (5.2.3.3) describes the bit fields used to specify payload length type and number of payloads. The number of payloads field is a 6-bit field, meaning a packet can hold a maximum of 63 payloads.
asfenc.c was not honoring this, and if more than 63 payloads would fit in a packet, the "number of payloads" field would overflow into the "payload length type" field, causing parsing errors in ffplay.
You can reproduce this with any AAC file that has several seconds of silence in the beginning (lots of very small AAC frames). Use this ffmpeg command:
$ ffmpeg -i silence.m4a -acodec copy silence.asf
Note that ffplay will get lots of errors.
Anyway, here's a patch to fix the problem. I already submitted this to ffmpeg-devel.
diff -ur ffmpeg-mine/libavformat/asfenc.c ffmpeg-2.2.2/libavformat/asfenc.c --- ffmpeg-mine/libavformat/asfenc.c 2014-05-12 15:23:12.093259469 -0700 +++ ffmpeg-2.2.2/libavformat/asfenc.c 2014-05-04 21:14:52.000000000 -0700 @@ -34,7 +34,6 @@ #define ASF_INDEXED_INTERVAL 10000000 #define ASF_INDEX_BLOCK (1<<9) -#define ASF_PAYLOADS_PER_PACKET 63 #define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2 #define ASF_PACKET_ERROR_CORRECTION_FLAGS \ @@ -819,8 +818,6 @@ flush_packet(s); else if (asf->packet_size_left <= (PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS + PACKET_HEADER_MIN_SIZE + 1)) flush_packet(s); - else if (asf->packet_nb_payloads == ASF_PAYLOADS_PER_PACKET) - flush_packet(s); } stream->seq++; }
Attachments (1)
Change History (3)
by , 11 years ago
Attachment: | silence.m4a added |
---|
comment:1 by , 11 years ago
Reproduced by developer: | set |
---|---|
Resolution: | → fixed |
Status: | new → closed |
patch applied (72dcd48c19a655f8928af5b42b481527a15bf487)
comment:2 by , 11 years ago
Description: | modified (diff) |
---|---|
Keywords: | asf added |
Version: | unspecified → git-master |
Use the ffmpeg command to remux this file to ASF to see the problem