Lines Matching defs:length
77 #define EBML_UNKNOWN_LENGTH UINT64_MAX /* EBML unknown length, in uint64_t */
346 uint64_t length;
869 * so treat the segment as unknown length in order not to
872 matroska->levels[0].length = EBML_UNKNOWN_LENGTH;
883 * Read: an "EBML number", which is defined as a variable-length
884 * array of bytes. The first byte indicates the length by giving a
886 * "one" bit inside the first byte indicates the length of this
897 /* The first byte tells us the length in bytes - except when it is zero. */
902 /* get the length of the EBML number */
914 "at pos %"PRId64" (0x%"PRIx64") exceeds max length %d.\n",
920 /* read out length */
951 * Read a EBML length value.
952 * This needs special handling for the "unknown length" case which has multiple
1063 static int ebml_read_binary(AVIOContext *pb, int length,
1068 ret = av_buffer_realloc(&bin->buf, length + AV_INPUT_BUFFER_PADDING_SIZE);
1071 memset(bin->buf->data + length, 0, AV_INPUT_BUFFER_PADDING_SIZE);
1074 bin->size = length;
1076 if ((ret = avio_read(pb, bin->data, length)) != length) {
1092 uint64_t length, int64_t pos)
1104 level->length = length;
1175 if (!matroska->levels[matroska->num_levels - 1].length) {
1191 // will contain the leading length bit. This bit in turn identifies the
1192 // total byte length of the element by its position within the byte.
1239 // Forbid unknown-length EBML_NONE elements.
1253 uint64_t length;
1268 if (level->length == EBML_UNKNOWN_LENGTH) {
1269 // Unknown-length levels automatically end at EOF.
1291 if (level && level->length == EBML_UNKNOWN_LENGTH) {
1292 // Unknown-length levels end when an element from an upper level
1330 if ((res = ebml_read_length(matroska, pb, &length)) < 0)
1336 if (length != EBML_UNKNOWN_LENGTH &&
1337 level->length != EBML_UNKNOWN_LENGTH) {
1338 uint64_t elem_end = pos_alt + length,
1339 level_end = level->start + level->length;
1352 } else if (length != EBML_UNKNOWN_LENGTH) {
1354 } else if (level->length != EBML_UNKNOWN_LENGTH) {
1363 // segments are allowed to be unknown-length. We also accept
1364 // other unknown-length master elements.
1366 "Found unknown-length element 0x%"PRIX32" other than "
1375 if (max_lengths[syntax->type] && length > max_lengths[syntax->type]) {
1376 if (length != EBML_UNKNOWN_LENGTH) {
1378 "Invalid length 0x%"PRIx64" > 0x%"PRIx64" for element "
1380 length, max_lengths[syntax->type], id, pos);
1384 "unknown length, yet the length of an element of its "
1388 "Found unknown-length element with ID 0x%"PRIX32" at "
1402 // skipped or considered defective based upon the length of the
1414 // This is especially important when using unkown length elements
1420 int64_t dist = length + UNKNOWN_EQUIV * matroska->unknown_count++;
1428 "length 0x%"PRIx64" considered as invalid data. Last "
1430 " in a row\n", id, pos, length, matroska->resync_pos,
1444 if (!data && length != EBML_UNKNOWN_LENGTH)
1450 res = ebml_read_uint(pb, length, syntax->def.u, data);
1453 res = ebml_read_sint(pb, length, syntax->def.i, data);
1456 res = ebml_read_float(pb, length, syntax->def.f, data);
1460 res = ebml_read_ascii(pb, length, syntax->def.s, data);
1463 res = ebml_read_binary(pb, length, pos_alt, data);
1467 if ((res = ebml_read_master(matroska, length, pos_alt)) < 0)
1489 if (length) {
1491 if (ffio_limit(pb, length) != length) {
1496 if ((res2 = avio_skip(pb, length - 1)) >= 0) {
1498 // by skipping only length - 1 bytes, reading a byte and
1544 // level->length != EBML_UNKNOWN_LENGTH is necessary.
1545 while (matroska->num_levels && pos == level->start + level->length) {
1598 /* length of header */
1611 /* Unknown-length header - simply parse the whole buffer. */
3807 * zero-length header removal compression being ignored. */
4074 // read cluster id and length
4089 // 4 + read is the length of the cluster id and the cluster length field.
4303 // cues_end is computed as cues_start + cues_length + length of the
4304 // Cues element ID (i.e. 4) + EBML length of the Cues element.