diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-26 03:31:31 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-27 14:26:48 +0200 |
commit | 49b80fe6b45dad5b04d3903987b287f957b94259 (patch) | |
tree | 7cf380b94c7750bb5d3fe60af3781d6efa3cee1c /libmpdemux/demux_lavf.c | |
parent | 298808cddc40b66dde9578ec8abb71094357c3ce (diff) | |
download | mpv-49b80fe6b45dad5b04d3903987b287f957b94259.tar.bz2 mpv-49b80fe6b45dad5b04d3903987b287f957b94259.tar.xz |
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.
Diffstat (limited to 'libmpdemux/demux_lavf.c')
-rw-r--r-- | libmpdemux/demux_lavf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 622b87d45a..ad958889ed 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -408,8 +408,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { } case CODEC_TYPE_ATTACHMENT:{ if (st->codec->codec_id == CODEC_ID_TTF) - demuxer_add_attachment(demuxer, st->filename, - "application/x-truetype-font", + demuxer_add_attachment(demuxer, st->filename, INT_MAX, + "application/x-truetype-font", INT_MAX, codec->extradata, codec->extradata_size); break; } @@ -489,7 +489,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){ uint64_t start = av_rescale_q(c->start, c->time_base, (AVRational){1,1000}); uint64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,1000}); t = av_metadata_get(c->metadata, "title", NULL, 0); - demuxer_add_chapter(demuxer, t ? t->value : NULL, start, end); + demuxer_add_chapter(demuxer, t ? t->value : NULL, INT_MAX, start, end); } for(i=0; i<avfc->nb_streams; i++) |