From bbbea7934f6c3f1531e000e4b51ff8adcca7923c Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 14 Jan 2014 17:38:44 +0100 Subject: ebml: remove unused functions These were mostly replaced by ebml_read_element(). --- demux/ebml.c | 86 ------------------------------------------------------------ demux/ebml.h | 4 --- 2 files changed, 90 deletions(-) diff --git a/demux/ebml.c b/demux/ebml.c index 2c540ad093..d50647e5f0 100644 --- a/demux/ebml.c +++ b/demux/ebml.c @@ -206,70 +206,6 @@ int64_t ebml_read_int(stream_t *s, uint64_t *length) return value; } -/* - * Read the next element as a float. - */ -double ebml_read_float(stream_t *s, uint64_t *length) -{ - double value; - uint64_t len; - int l; - - len = ebml_read_length(s, &l); - switch (len) { - case 4: - value = av_int2float(stream_read_dword(s)); - break; - - case 8: - value = av_int2double(stream_read_qword(s)); - break; - - default: - return EBML_FLOAT_INVALID; - } - - if (length) - *length = len + l; - - return value; -} - -/* - * Read the next element as an ASCII string. - */ -char *ebml_read_ascii(stream_t *s, uint64_t *length) -{ - uint64_t len; - char *str; - int l; - - len = ebml_read_length(s, &l); - if (len == EBML_UINT_INVALID) - return NULL; - if (len > SIZE_MAX - 1) - return NULL; - if (length) - *length = len + l; - - str = malloc(len + 1); - if (stream_read(s, str, len) != (int) len) { - free(str); - return NULL; - } - str[len] = '\0'; - - return str; -} - -/* - * Read the next element as a UTF-8 string. - */ -char *ebml_read_utf8(stream_t *s, uint64_t *length) -{ - return ebml_read_ascii(s, length); -} - /* * Skip the current element. * end: the end of the parent element or -1 (for robust error handling) @@ -322,28 +258,6 @@ int ebml_resync_cluster(struct mp_log *log, stream_t *s) return -1; } -/* - * Read the next element, but only the header. The contents - * are supposed to be sub-elements which can be read separately. - */ -uint32_t ebml_read_master(stream_t *s, uint64_t *length) -{ - uint64_t len; - uint32_t id; - - id = ebml_read_id(s, NULL); - if (id == EBML_ID_INVALID) - return id; - - len = ebml_read_length(s, NULL); - if (len == EBML_UINT_INVALID) - return EBML_ID_INVALID; - if (length) - *length = len; - - return id; -} - #define EVALARGS(F, ...) F(__VA_ARGS__) diff --git a/demux/ebml.h b/demux/ebml.h index b934ee5c34..80943d33e4 100644 --- a/demux/ebml.h +++ b/demux/ebml.h @@ -99,12 +99,8 @@ int64_t ebml_read_vlen_int (bstr *buffer); uint64_t ebml_read_length (stream_t *s, int *length); uint64_t ebml_read_uint (stream_t *s, uint64_t *length); int64_t ebml_read_int (stream_t *s, uint64_t *length); -double ebml_read_float (stream_t *s, uint64_t *length); -char *ebml_read_ascii (stream_t *s, uint64_t *length); -char *ebml_read_utf8 (stream_t *s, uint64_t *length); int ebml_read_skip(struct mp_log *log, int64_t end, stream_t *s); int ebml_resync_cluster(struct mp_log *log, stream_t *s); -uint32_t ebml_read_master (stream_t *s, uint64_t *length); int ebml_read_element(struct stream *s, struct ebml_parse_ctx *ctx, void *target, const struct ebml_elem_desc *desc); -- cgit v1.2.3