mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
stream: remove old chapter handling code
Stream-level chapters (like DVD etc.) did potentially not have timestamps for each chapter, so STREAM_CTRL_SEEK_TO_CHAPTER and STREAM_CTRL_GET_CURRENT_CHAPTER were needed to navigate chapters. We've switched everything to use timestamps and that seems to work, so we can simplify the code and remove this old mechanism.
This commit is contained in:
@@ -466,17 +466,6 @@ static int control(stream_t *stream, int cmd, void *arg)
|
||||
int tit, part;
|
||||
|
||||
switch (cmd) {
|
||||
case STREAM_CTRL_SEEK_TO_CHAPTER: {
|
||||
int chap = *(unsigned int *)arg + 1;
|
||||
|
||||
if (chap < 1)
|
||||
break;
|
||||
if (dvdnav_current_title_info(dvdnav, &tit, &part) != DVDNAV_STATUS_OK)
|
||||
break;
|
||||
if (dvdnav_part_play(dvdnav, tit, chap) != DVDNAV_STATUS_OK)
|
||||
break;
|
||||
return 1;
|
||||
}
|
||||
case STREAM_CTRL_GET_NUM_CHAPTERS: {
|
||||
if (dvdnav_current_title_info(dvdnav, &tit, &part) != DVDNAV_STATUS_OK)
|
||||
break;
|
||||
@@ -502,12 +491,6 @@ static int control(stream_t *stream, int cmd, void *arg)
|
||||
free(parts);
|
||||
return 1;
|
||||
}
|
||||
case STREAM_CTRL_GET_CURRENT_CHAPTER: {
|
||||
if (dvdnav_current_title_info(dvdnav, &tit, &part) != DVDNAV_STATUS_OK)
|
||||
break;
|
||||
*(unsigned int *)arg = part - 1;
|
||||
return 1;
|
||||
}
|
||||
case STREAM_CTRL_GET_TIME_LENGTH: {
|
||||
if (priv->duration) {
|
||||
*(double *)arg = (double)priv->duration / 1000.0;
|
||||
|
||||
Reference in New Issue
Block a user