/* Read the next element, but only the header. The contents are supposed to be sub-elements which can be read separately. 0 is success, < 0 is failure.  */
static int ebml_read_master(MatroskaDemuxContext *matroska, int length)
/* Read the next element, but only the header. The contents are supposed to be sub-elements which can be read separately. 0 is success, < 0 is failure.  */
static int ebml_read_master(MatroskaDemuxContext *matroska, int length)
{
    ByteIOContext *pb = matroska->ctx->pb;
    MatroskaLevel *level;
    if (matroska->num_levels >= EBML_MAX_DEPTH) {
        av_log(matroska->ctx, AV_LOG_ERROR,
               "File moves beyond max. allowed depth (%d)\n", EBML_MAX_DEPTH);
        return AVERROR(ENOSYS);
    }
    level = &matroska->levels[matroska->num_levels++];
    level->start = url_ftell(pb);
    level->length = length;
    return 0;
}