<div>Hi, I've been developing the iPhone version of <a href="http://www.openwatch.net/">Cop Recorder</a> but we have been getting some corrupted .caf (Core Audio container) files that are missing a valid packet table. I assume this is because we aren't properly stopping the recording when a device is multitasking, but I haven't been able to isolate the bug and we have a few corrupted recordings now. I'd like to salvage as many recordings as we can, because the only thing we seem to be missing is the packet table.</div>
<div><br></div><div>ffmpeg reports the following:</div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
[caf @ 0x7fbee284ac00] Missing packet table. It is required when block size or frame size are variable.</blockquote><div><br></div><div>The <a href="http://developer.apple.com/library/mac/#documentation/MusicAudio/Reference/CAFSpec/CAF_spec/CAF_spec.html#//apple_ref/doc/uid/TP40001862-CH210-DontLinkElementID_64">CAF specificiation</a> states:</div>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">"Variable bit rate, constant number of frames per packet (such as AAC and variable-bit-rate MP3): mBytesPerPacket is zero, mFramesPerPacket is nonzero.<br>
The Packet Table chunk data section contains single-number entries that describe the size, in bytes, of each packet in the Audio Data chunk."</blockquote><div><br></div><div><a href="http://chrisballinger.info/files/1309554492.caf">Valid CAF file containing AAC</a></div>
<div><a href="http://chrisballinger.info/files/1310362242.caf">Corrupted CAF file missing packet table at end of file</a></div><div><br></div><div>Do you guys have any ideas? It seems that these are CBR AAC files so hopefully there might be a way to generate the packet table afterwards?</div>
<div><br></div><div>Thanks!</div>