mirror of https://github.com/mpv-player/mpv
dvd: drop last chapter
Apparently, libdvdnav always reports a last chapter that points to the exact end of the title. This is useless for us. Again, same possible caveats as with the previous commit.
This commit is contained in:
parent
13ae78d207
commit
8b7418db97
|
@ -489,7 +489,7 @@ static int control(stream_t *stream, int cmd, void *arg)
|
||||||
break;
|
break;
|
||||||
if (!part)
|
if (!part)
|
||||||
break;
|
break;
|
||||||
*(unsigned int *)arg = part + 1;
|
*(unsigned int *)arg = part;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
case STREAM_CTRL_GET_CHAPTER_TIME: {
|
case STREAM_CTRL_GET_CHAPTER_TIME: {
|
||||||
|
@ -501,7 +501,7 @@ static int control(stream_t *stream, int cmd, void *arg)
|
||||||
int n = dvdnav_describe_title_chapters(dvdnav, tit, &parts, &duration);
|
int n = dvdnav_describe_title_chapters(dvdnav, tit, &parts, &duration);
|
||||||
if (!parts)
|
if (!parts)
|
||||||
break;
|
break;
|
||||||
if (chapter < 0 || chapter >= n)
|
if (chapter < 0 || chapter + 1 >= n)
|
||||||
break;
|
break;
|
||||||
*ch = chapter > 0 ? parts[chapter - 1] / 90000.0 : 0;
|
*ch = chapter > 0 ? parts[chapter - 1] / 90000.0 : 0;
|
||||||
free(parts);
|
free(parts);
|
||||||
|
|
Loading…
Reference in New Issue