Mercurial > mplayer.hg
diff mplayer.c @ 19478:bab82c53e433
demuxer_seek_chapter() returns informations about chapters count and name
author | nicodvb |
---|---|
date | Mon, 21 Aug 2006 19:19:00 +0000 |
parents | ecd8f562e19b |
children | d04ee0eb6a11 |
line wrap: on
line diff
--- a/mplayer.c Mon Aug 21 19:16:39 2006 +0000 +++ b/mplayer.c Mon Aug 21 19:19:00 2006 +0000 @@ -4822,18 +4822,22 @@ int abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; int chap; float next_pts = 0; + int num_chapters; + char *chapter_name; rel_seek_secs = 0; abs_seek_pos = 0; - chap = demuxer_seek_chapter(demuxer, seek, abs, &next_pts); + chap = demuxer_seek_chapter(demuxer, seek, abs, &next_pts, &num_chapters, &chapter_name); if(chap != -1) { if(next_pts > -1.0) { abs_seek_pos = 1; rel_seek_secs = next_pts; } - if(demuxer->num_chapters > chap) + if(chapter_name) { set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, MSGTR_OSDChapter, - chap, demuxer->chapters[chap].name); + chap, chapter_name); + free(chapter_name); + } } else { if (seek > 0) rel_seek_secs = 1000000000.;