On 1/6/2017 2:41 PM, Soft Works wrote: >> From: ffmpeg-devel <ffmpeg-devel-boun...@ffmpeg.org> on behalf of James >> Almer <jamr...@gmail.com> >> Sent: Friday, January 6, 2017 6:02 AM >> >> IMO, no point calculating and writing a CRC element for this temporary state. >> You can rename and simplify this function into something like >> >> static void end_ebml_master_preliminary(AVIOContext *pb, AVIOContext >> **dyn_cp, >> ebml_master master) >> { >> uint8_t *buf; >> int size = avio_get_dyn_buf(*dyn_cp, &buf); >> >> avio_write(pb, buf, size); >> end_ebml_master(pb, master); >> } > > James, > > thanks for looking into this! > > I wasn't sure if clients would be OK when some headers have CRC and some have > not > (in the preliminary state). Also I'm not sure if clients are OK with the CRC > bytes being > zero. > But if you're sure that all this is fine, I'll make this change... > > softworkz
start_ebml_master_crc32() only reserves the space needed for the CRC32 element, which is then written by end_ebml_master_crc32(). The preliminary header will have a couple six bytes long Void elements that every parser will promptly ignore. CRC32 elements on this preliminarily state are pointless. Extra cycles wasted calculating something that will be overwritten and recalculated at the end of the process. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel