mp4box never finishes importing ac3 file for a certain ac3 file.
In media_import.c gf_import_ac3() the while loop runs forever on certain ac3 files. This happens because the bitstream length - position is less than sample->dataLength, so gf_bs_read_data() does not read anything from the stream so it does not advance the position, yet there are > 6 bytes left in the bitstream, so the loop never terminates. Apparently my ac3 ends with a partial sample, and the code does not handle that case. If the stream position is not advancing then the loop never terminates.
I just created this ac3 file with dgindex. In any case mp4box should probably not hang forever on a bad ac3.
I think the fix is something like break out of the while loop if remaining bytes in bitstream is less than samp->dataLength. Maybe based on return value of 0 from gf_bs_read_data() but there is another case in there that returns 0 so not sure.
Hi, thanks for reporting.
Would it be possible to share a sample file with us? You can use wetransfer.com for example (stays alive for one week). And send it via PM if you don't want the URL do be public.
Thanks,
Romain
Hi Romain,
I used WeTransfer to share the file with you. Please let me know if you
have any trouble with it.
Ryan
On Mon, Mar 10, 2014 at 12:59 AM, Romain Bouqueau rbouqueau@users.sf.netwrote:
Related
Bugs: #304