comparison matroskadec.c @ 3683:eb0eeba954df libavformat

matroskadec: remove now useless wrapper ebml_read_element_length()
author aurel
date Tue, 05 Aug 2008 00:42:36 +0000
parents 1332d68c8210
children 2350faade9fb
comparison
equal deleted inserted replaced
3682:1332d68c8210 3683:eb0eeba954df
538 538
539 return 0; 539 return 0;
540 } 540 }
541 541
542 /* 542 /*
543 * Read: element content length.
544 * Return: the number of bytes read or < 0 on error.
545 */
546 static int ebml_read_element_length(MatroskaDemuxContext *matroska,
547 uint64_t *length)
548 {
549 /* read out the "EBML number", include tag in ID */
550 return ebml_read_num(matroska, 8, length);
551 }
552
553 /*
554 * Read the next element as an unsigned int. 543 * Read the next element as an unsigned int.
555 * 0 is success, < 0 is failure. 544 * 0 is success, < 0 is failure.
556 */ 545 */
557 static int ebml_read_uint(ByteIOContext *pb, int size, uint64_t *num) 546 static int ebml_read_uint(ByteIOContext *pb, int size, uint64_t *num)
558 { 547 {
841 memset(data, 0, syntax->list_elem_size); 830 memset(data, 0, syntax->list_elem_size);
842 list->nb_elem++; 831 list->nb_elem++;
843 } 832 }
844 833
845 if (syntax->type != EBML_PASS && syntax->type != EBML_STOP) 834 if (syntax->type != EBML_PASS && syntax->type != EBML_STOP)
846 if ((res = ebml_read_element_length(matroska, &length)) < 0) 835 if ((res = ebml_read_num(matroska, 8, &length)) < 0)
847 return res; 836 return res;
848 837
849 switch (syntax->type) { 838 switch (syntax->type) {
850 case EBML_UINT: res = ebml_read_uint (pb, length, data); break; 839 case EBML_UINT: res = ebml_read_uint (pb, length, data); break;
851 case EBML_FLOAT: res = ebml_read_float (pb, length, data); break; 840 case EBML_FLOAT: res = ebml_read_float (pb, length, data); break;