From f12c83b85b135c1cb9fb34e978eb0c8051450da8 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Wed, 1 Apr 2009 19:55:26 +0300 Subject: Change demuxer_seek_chapter() parameters Remove the "num_chapters" and "mode" parameters that aren't needed by any callers. Change "float *seek_pts" to "double *". Allocate the string returned via "chapter_name" with talloc. --- command.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 7c0352398f..97fc66ba7c 100644 --- a/command.c +++ b/command.c @@ -387,8 +387,6 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, { struct MPOpts *opts = &mpctx->opts; int chapter = -1; - float next_pts = 0; - int chapter_num; int step_all; char *chapter_name = NULL; @@ -431,10 +429,12 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, default: return M_PROPERTY_NOT_IMPLEMENTED; } + + double next_pts = 0; + chapter = demuxer_seek_chapter(mpctx->demuxer, chapter, &next_pts, + &chapter_name); mpctx->rel_seek_secs = 0; mpctx->abs_seek_pos = 0; - chapter = demuxer_seek_chapter(mpctx->demuxer, chapter, 1, - &next_pts, &chapter_num, &chapter_name); if (chapter >= 0) { if (next_pts > -1.0) { mpctx->abs_seek_pos = SEEK_ABSOLUTE; @@ -450,7 +450,7 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, set_osd_msg(OSD_MSG_TEXT, 1, opts->osd_duration, MSGTR_OSDChapter, 0, MSGTR_Unknown); if (chapter_name) - free(chapter_name); + talloc_free(chapter_name); return M_PROPERTY_OK; } -- cgit v1.2.3