static int start_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv,
                                   ebml_master *master, unsigned int elementid, uint64_t expectedsize)
{
    int ret;

    if ((ret = avio_open_dyn_buf(dyn_cp)) < 0)
        return ret;

    if (pb->seekable) {
        *master = start_ebml_master(pb, elementid, expectedsize);
        if (mkv->write_crc && mkv->mode != MODE_WEBM)
            put_ebml_void(*dyn_cp, 6); /* Reserve space for CRC32 so position/size calculations using avio_tell() take it into account */
    } else
        *master = start_ebml_master(*dyn_cp, elementid, expectedsize);

    return 0;
}