From 49b80fe6b45dad5b04d3903987b287f957b94259 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 26 Jan 2010 03:31:31 +0200 Subject: demux: take chapter/attachment name strings without 0-termination Change the demuxer_add_attachment() and demuxer_add_chapter() functions to take a length argument for various name strings, so those strings do not need to be 0-terminated. This will make it easier to directly pass demuxed data without first making a copy just to add 0-termination. Also allocate the struct demuxer data structures for attachments and chapters with talloc. --- libmpdemux/demuxer.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libmpdemux/demuxer.h') diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index 5da35efa03..375c0d0ccf 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -452,10 +452,11 @@ int demuxer_type_by_filename(char* filename); void demuxer_help(void); int get_demuxer_type_from_name(char *demuxer_name, int *force); -int demuxer_add_attachment(demuxer_t* demuxer, const char* name, - const char* type, const void* data, size_t size); - -int demuxer_add_chapter(demuxer_t* demuxer, const char* name, uint64_t start, uint64_t end); +int demuxer_add_attachment(demuxer_t *demuxer, const char *name, + int name_maxlen, const char *type, int type_maxlen, + const void *data, size_t size); +int demuxer_add_chapter(demuxer_t *demuxer, const char *name, int name_maxlen, + uint64_t start, uint64_t end); int demuxer_seek_chapter(demuxer_t *demuxer, int chapter, double *seek_pts, char **chapter_name); -- cgit v1.2.3