mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
options: move -chapter values to option struct
-chapter can optionally take a range with a start and an end. Add a new option type which supports such values and use that instead of a custom per-option function. This commit also fixes a build configuration bug: before the availability of the -chapter option depended on DVD functionality being enabled in the binary, even though the option works with other sources too.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "options.h"
|
||||
#include "mp_msg.h"
|
||||
#include "osdep/timer.h"
|
||||
#include "input/input.h"
|
||||
@@ -379,9 +380,9 @@ static int fill_buffer(stream_t *s, char *but, int len)
|
||||
priv->state &= ~NAV_FLAG_WAIT;
|
||||
if (priv->state & NAV_FLAG_WAIT_READ_AUTO)
|
||||
priv->state |= NAV_FLAG_WAIT_READ;
|
||||
if(priv->title > 0 && dvd_last_chapter > 0) {
|
||||
if(priv->title > 0 && s->opts->chapterrange[1] > 0) {
|
||||
int tit=0, part=0;
|
||||
if(dvdnav_current_title_info(priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK && part > dvd_last_chapter) {
|
||||
if(dvdnav_current_title_info(priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK && part > s->opts->chapterrange[1]) {
|
||||
priv->state |= NAV_FLAG_EOF;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user