summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-25 01:38:18 +0100
committerwm4 <wm4@nowhere>2014-03-25 01:38:18 +0100
commit2c693a47328a4faa9581a792c24448407629279b (patch)
tree4f98655f55f9213ce6258c81cf6ac55b9be06463 /stream/stream_dvd.c
parent7bd3f2648152d41db9a9d3f479358d0d8f38b210 (diff)
downloadmpv-2c693a47328a4faa9581a792c24448407629279b.tar.bz2
mpv-2c693a47328a4faa9581a792c24448407629279b.tar.xz
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.
Diffstat (limited to 'stream/stream_dvd.c')
-rw-r--r--stream/stream_dvd.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 93c9420086..3d6e3b3cb2 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -427,49 +427,6 @@ static int get_num_chapter(ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int title
return vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts;
}
-static int seek_to_chapter(stream_t *stream, ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int title_no, int chapter)
-{
- dvd_priv_t *d = stream->priv;
- ptt_info_t ptt;
- pgc_t *pgc;
- int64_t pos;
-
- if(!vts_file || !tt_srpt)
- return 0;
-
- if(title_no < 0 || title_no >= tt_srpt->nr_of_srpts)
- return 0;
-
- // map global title to vts title
- title_no = tt_srpt->title[title_no].vts_ttn - 1;
-
- if(title_no < 0 || title_no >= vts_file->vts_ptt_srpt->nr_of_srpts)
- return 0;
-
- if(chapter < 0 || chapter > vts_file->vts_ptt_srpt->title[title_no].nr_of_ptts-1) //no such chapter
- return 0;
-
- ptt = vts_file->vts_ptt_srpt->title[title_no].ptt[chapter];
- pgc = vts_file->vts_pgcit->pgci_srp[ptt.pgcn-1].pgc;
-
- d->cur_cell = pgc->program_map[ptt.pgn - 1] - 1;
- if(pgc->cell_playback[d->cur_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK)
- d->cur_cell += dvd_angle-1;
- d->cur_pack = pgc->cell_playback[d->cur_cell].first_sector;
- d->cell_last_pack = pgc->cell_playback[d->cur_cell].last_sector;
-
- d->packs_left = -1;
- d->angle_seek = 0;
-
- pos = (int64_t) d->cur_pack * 2048;
- stream_seek(stream, pos);
-
- MP_VERBOSE(stream, "\r\nSTREAM_DVD, seeked to chapter: %d, cell: %u, pos: %"PRIu64"\n",
- chapter, d->cur_pack, pos);
-
- return chapter;
-}
-
// p: in=chapter number, out=PTS
static int get_chapter_time(ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int title_no, double *p)
{
@@ -642,24 +599,11 @@ static int control(stream_t *stream,int cmd,void* arg)
if(! r) return STREAM_UNSUPPORTED;
return 1;
}
- case STREAM_CTRL_SEEK_TO_CHAPTER:
- {
- int r;
- r = seek_to_chapter(stream, d->vts_file, d->tt_srpt, d->cur_title, *((unsigned int *)arg));
- if(! r) return STREAM_UNSUPPORTED;
-
- return 1;
- }
case STREAM_CTRL_GET_CURRENT_TITLE:
{
*((unsigned int *)arg) = d->cur_title;
return 1;
}
- case STREAM_CTRL_GET_CURRENT_CHAPTER:
- {
- *((unsigned int *)arg) = dvd_chapter_from_cell(d, d->cur_title, d->cur_cell);
- return 1;
- }
case STREAM_CTRL_GET_CURRENT_TIME:
{
double tm;