Mercurial > mplayer.hg
annotate libmpdemux/open.c @ 2790:98769cea155c
added tv subsystem
author | alex |
---|---|
date | Fri, 09 Nov 2001 23:46:06 +0000 |
parents | c3c73ba53f0e |
children | 09d5c9834580 |
rev | line source |
---|---|
1467 | 1 |
2 #include <stdio.h> | |
3 #include <stdlib.h> | |
4 #include <string.h> | |
5 #include <unistd.h> | |
6 #include <fcntl.h> | |
7 | |
8 #include "config.h" | |
1567 | 9 #include "mp_msg.h" |
1584 | 10 #include "help_mp.h" |
1467 | 11 |
1468 | 12 #ifdef __FreeBSD__ |
13 #include <sys/cdrio.h> | |
14 #endif | |
15 | |
1467 | 16 #include "stream.h" |
1482 | 17 #include "demuxer.h" |
1467 | 18 |
19 #ifdef STREAMING | |
20 #include "url.h" | |
21 #include "network.h" | |
22 static URL_t* url; | |
23 #endif | |
24 | |
1596 | 25 int dvd_title=0; |
26 int dvd_chapter=1; | |
27 int dvd_angle=1; | |
28 | |
29 #ifdef USE_DVDREAD | |
30 | |
31 #include <dvdread/dvd_reader.h> | |
32 #include <dvdread/ifo_types.h> | |
33 #include <dvdread/ifo_read.h> | |
34 #include <dvdread/nav_read.h> | |
1875 | 35 |
36 #define DVDREAD_VERSION(maj,min,micro) ((maj)*10000 + (min)*100 + (micro)) | |
37 | |
38 /* | |
39 * Try to autodetect the libdvd-0.9.0 library | |
40 * (0.9.0 removed the <dvdread/dvd_udf.h> header, and moved the two defines | |
41 * DVD_VIDEO_LB_LEN and MAX_UDF_FILE_NAME_LEN from it to | |
42 * <dvdread/dvd_reader.h>) | |
43 */ | |
44 #if defined(DVD_VIDEO_LB_LEN) && defined(MAX_UDF_FILE_NAME_LEN) | |
45 #define LIBDVDREAD_VERSION DVDREAD_VERSION(0,9,0) | |
46 #else | |
47 #define LIBDVDREAD_VERSION DVDREAD_VERSION(0,8,0) | |
48 #endif | |
49 | |
1596 | 50 |
51 typedef struct { | |
52 dvd_reader_t *dvd; | |
53 dvd_file_t *title; | |
54 ifo_handle_t *vmg_file; | |
55 tt_srpt_t *tt_srpt; | |
56 ifo_handle_t *vts_file; | |
57 vts_ptt_srpt_t *vts_ptt_srpt; | |
58 pgc_t *cur_pgc; | |
59 // | |
60 int cur_cell; | |
61 int cur_pack; | |
62 int cell_last_pack; | |
63 // Navi: | |
64 int packs_left; | |
65 dsi_t dsi_pack; | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
66 int angle_seek; |
1596 | 67 } dvd_priv_t; |
68 | |
69 #endif | |
70 | |
1467 | 71 extern int vcd_get_track_end(int fd,int track); |
72 | |
2790 | 73 #ifdef USE_TV |
74 #include "tv.h" | |
75 extern tvi_handle_t *tv_handler; | |
76 #endif | |
77 | |
1467 | 78 // Open a new stream (stdin/file/vcd/url) |
79 | |
80 stream_t* open_stream(char* filename,int vcd_track,int* file_format){ | |
81 stream_t* stream=NULL; | |
82 int f=-1; | |
83 off_t len; | |
84 #ifdef VCD_CACHE | |
85 int vcd_cache_size=128; | |
86 #endif | |
87 #ifdef __FreeBSD__ | |
88 int bsize = VCD_SECTOR_SIZE; | |
89 #endif | |
90 | |
91 //============ Open VideoCD track ============== | |
92 if(vcd_track){ | |
93 int ret,ret2; | |
1596 | 94 if(!filename) filename=DEFAULT_CDROM_DEVICE; |
1467 | 95 f=open(filename,O_RDONLY); |
1584 | 96 if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CdDevNotfound,filename);return NULL; } |
1467 | 97 vcd_read_toc(f); |
98 ret2=vcd_get_track_end(f,vcd_track); | |
1584 | 99 if(ret2<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (get)\n");return NULL;} |
1467 | 100 ret=vcd_seek_to_track(f,vcd_track); |
1584 | 101 if(ret<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");return NULL;} |
1467 | 102 // seek_to_byte+=ret; |
1567 | 103 mp_msg(MSGT_OPEN,MSGL_V,"VCD start byte position: 0x%X end: 0x%X\n",ret,ret2); |
1467 | 104 #ifdef VCD_CACHE |
105 vcd_cache_init(vcd_cache_size); | |
106 #endif | |
107 #ifdef __FreeBSD__ | |
108 if (ioctl (f, CDRIOCSETBLOCKSIZE, &bsize) == -1) { | |
109 perror ( "Error in CDRIOCSETBLOCKSIZE"); | |
110 } | |
111 #endif | |
112 stream=new_stream(f,STREAMTYPE_VCD); | |
113 stream->start_pos=ret; | |
114 stream->end_pos=ret2; | |
115 return stream; | |
116 } | |
117 | |
1596 | 118 //============ Open DVD title ============== |
119 #ifdef USE_DVDREAD | |
120 if(dvd_title){ | |
2050 | 121 // int ret,ret2; |
1596 | 122 dvd_priv_t *d; |
123 int ttn,pgc_id,pgn; | |
124 dvd_reader_t *dvd; | |
125 dvd_file_t *title; | |
126 ifo_handle_t *vmg_file; | |
127 tt_srpt_t *tt_srpt; | |
128 ifo_handle_t *vts_file; | |
129 /** | |
130 * Open the disc. | |
131 */ | |
132 if(!filename) filename=DEFAULT_DVD_DEVICE; | |
133 dvd = DVDOpen(filename); | |
134 if( !dvd ) { | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
135 mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenDVD,filename); |
1596 | 136 return NULL; |
137 } | |
138 | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
139 mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_DVDwait); |
1596 | 140 |
141 /** | |
142 * Load the video manager to find out the information about the titles on | |
143 * this disc. | |
144 */ | |
145 vmg_file = ifoOpen( dvd, 0 ); | |
146 if( !vmg_file ) { | |
147 mp_msg(MSGT_OPEN,MSGL_ERR, "Can't open VMG info!\n"); | |
148 DVDClose( dvd ); | |
149 return NULL; | |
150 } | |
151 tt_srpt = vmg_file->tt_srpt; | |
152 /** | |
153 * Make sure our title number is valid. | |
154 */ | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
155 mp_msg(MSGT_OPEN,MSGL_INFO, MSGTR_DVDnumTitles, |
1596 | 156 tt_srpt->nr_of_srpts ); |
157 if( dvd_title < 1 || dvd_title > tt_srpt->nr_of_srpts ) { | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
158 mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidTitle, dvd_title); |
1596 | 159 ifoClose( vmg_file ); |
160 DVDClose( dvd ); | |
161 return NULL; | |
162 } | |
163 --dvd_title; // remap 1.. -> 0.. | |
164 /** | |
165 * Make sure the chapter number is valid for this title. | |
166 */ | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
167 mp_msg(MSGT_OPEN,MSGL_INFO, MSGTR_DVDnumChapters, |
1596 | 168 tt_srpt->title[dvd_title].nr_of_ptts ); |
169 if( dvd_chapter<1 || dvd_chapter>tt_srpt->title[dvd_title].nr_of_ptts ) { | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
170 mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidChapter, dvd_chapter); |
1596 | 171 ifoClose( vmg_file ); |
172 DVDClose( dvd ); | |
173 return NULL; | |
174 } | |
175 --dvd_chapter; // remap 1.. -> 0.. | |
176 /** | |
177 * Make sure the angle number is valid for this title. | |
178 */ | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
179 mp_msg(MSGT_OPEN,MSGL_INFO, MSGTR_DVDnumAngles, |
1596 | 180 tt_srpt->title[dvd_title].nr_of_angles ); |
181 if( dvd_angle<1 || dvd_angle>tt_srpt->title[dvd_title].nr_of_angles ) { | |
1977 | 182 mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidAngle, dvd_angle); |
1596 | 183 ifoClose( vmg_file ); |
184 DVDClose( dvd ); | |
185 return NULL; | |
186 } | |
1617 | 187 --dvd_angle; // remap 1.. -> 0.. |
1596 | 188 /** |
189 * Load the VTS information for the title set our title is in. | |
190 */ | |
191 vts_file = ifoOpen( dvd, tt_srpt->title[dvd_title].title_set_nr ); | |
192 if( !vts_file ) { | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
193 mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDnoIFO, |
1596 | 194 tt_srpt->title[dvd_title].title_set_nr ); |
195 ifoClose( vmg_file ); | |
196 DVDClose( dvd ); | |
197 return NULL; | |
198 } | |
199 /** | |
200 * We've got enough info, time to open the title set data. | |
201 */ | |
202 title = DVDOpenFile( dvd, tt_srpt->title[dvd_title].title_set_nr, | |
203 DVD_READ_TITLE_VOBS ); | |
204 if( !title ) { | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
205 mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDnoVOBs, |
1596 | 206 tt_srpt->title[dvd_title].title_set_nr ); |
207 ifoClose( vts_file ); | |
208 ifoClose( vmg_file ); | |
209 DVDClose( dvd ); | |
210 return NULL; | |
211 } | |
212 | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1899
diff
changeset
|
213 mp_msg(MSGT_OPEN,MSGL_INFO, MSGTR_DVDopenOk); |
1596 | 214 // store data |
215 d=malloc(sizeof(dvd_priv_t)); memset(d,0,sizeof(dvd_priv_t)); | |
216 d->dvd=dvd; | |
217 d->title=title; | |
218 d->vmg_file=vmg_file; | |
219 d->tt_srpt=tt_srpt; | |
220 d->vts_file=vts_file; | |
221 | |
222 /** | |
223 * Determine which program chain we want to watch. This is based on the | |
224 * chapter number. | |
225 */ | |
226 ttn = tt_srpt->title[ dvd_title ].vts_ttn; // local | |
227 pgc_id = vts_file->vts_ptt_srpt->title[ttn-1].ptt[dvd_chapter].pgcn; // local | |
228 pgn = vts_file->vts_ptt_srpt->title[ttn-1].ptt[dvd_chapter].pgn; // local | |
229 d->cur_pgc = vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc; | |
230 d->cur_cell = d->cur_pgc->program_map[pgn-1] - 1; // start playback here | |
231 d->packs_left=-1; // for Navi stuff | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
232 d->angle_seek=0; |
1596 | 233 |
234 if( d->cur_pgc->cell_playback[d->cur_cell].block_type | |
235 == BLOCK_TYPE_ANGLE_BLOCK ) d->cur_cell+=dvd_angle; | |
236 d->cur_pack = d->cur_pgc->cell_playback[ d->cur_cell ].first_sector; | |
237 d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector; | |
238 mp_msg(MSGT_DVD,MSGL_V, "DVD start cell: %d pack: 0x%X-0x%X \n",d->cur_cell,d->cur_pack,d->cell_last_pack); | |
239 | |
240 // ... (unimplemented) | |
241 // return NULL; | |
242 stream=new_stream(-1,STREAMTYPE_DVD); | |
243 stream->start_pos=(off_t)d->cur_pack*2048; | |
244 //stream->end_pos=0; | |
245 stream->priv=(void*)d; | |
246 return stream; | |
247 } | |
248 #endif | |
249 | |
2790 | 250 #ifdef USE_TV |
251 //============ Check for TV-input ==== | |
252 if (tv_param_on==1) | |
253 { | |
254 stream=new_stream(-1,STREAMTYPE_TV); | |
255 tv_handler = tv_begin(); | |
256 if (!tv_handler) | |
257 return(NULL); | |
258 tv_init(tv_handler); | |
259 return(stream); | |
260 } | |
261 #endif | |
262 | |
1467 | 263 //============ Open STDIN ============ |
264 if(!strcmp(filename,"-")){ | |
265 // read from stdin | |
1584 | 266 mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN); |
1467 | 267 f=0; // 0=stdin |
268 stream=new_stream(f,STREAMTYPE_STREAM); | |
269 return stream; | |
270 } | |
271 | |
272 #ifdef STREAMING | |
273 url = url_new(filename); | |
274 if(url) { | |
275 (*file_format)=autodetectProtocol( url, &f ); | |
276 if( (*file_format)==DEMUXER_TYPE_UNKNOWN ) { | |
1584 | 277 mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, filename); |
1467 | 278 url_free(url); |
279 return NULL; | |
280 } | |
1899 | 281 f=streaming_start( &url, f, *file_format ); |
2315 | 282 //printf("streaming_start(%d) returned %d\n",*file_format,f); |
1584 | 283 if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, url->url); return NULL; } |
284 mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ConnToServer, url->hostname ); | |
1467 | 285 stream=new_stream(f,STREAMTYPE_STREAM); |
2315 | 286 // return NULL; |
287 return stream; | |
1467 | 288 } |
289 #endif | |
290 | |
291 //============ Open plain FILE ============ | |
292 f=open(filename,O_RDONLY); | |
1584 | 293 if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);return NULL; } |
1467 | 294 len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); |
295 if (len == -1) | |
296 perror("Error: lseek failed to obtain video file size"); | |
297 else | |
298 #ifdef _LARGEFILE_SOURCE | |
1567 | 299 mp_msg(MSGT_OPEN,MSGL_V,"File size is %lld bytes\n", (long long)len); |
1467 | 300 #else |
1567 | 301 mp_msg(MSGT_OPEN,MSGL_V,"File size is %u bytes\n", (unsigned int)len); |
1467 | 302 #endif |
303 stream=new_stream(f,STREAMTYPE_FILE); | |
304 stream->end_pos=len; | |
305 return stream; | |
306 | |
307 } | |
1596 | 308 |
309 | |
310 #ifdef USE_DVDREAD | |
311 | |
312 static int dvd_next_cell(dvd_priv_t *d){ | |
313 int next_cell=d->cur_cell; | |
1616 | 314 |
315 mp_msg(MSGT_DVD,MSGL_V, "dvd_next_cell: next1=0x%X \n",next_cell); | |
1596 | 316 |
317 if( d->cur_pgc->cell_playback[ next_cell ].block_type | |
318 == BLOCK_TYPE_ANGLE_BLOCK ) { | |
319 while(next_cell<d->cur_pgc->nr_of_cells){ | |
320 if( d->cur_pgc->cell_playback[next_cell].block_mode | |
321 == BLOCK_MODE_LAST_CELL ) break; | |
322 ++next_cell; | |
323 } | |
324 } | |
1616 | 325 mp_msg(MSGT_DVD,MSGL_V, "dvd_next_cell: next2=0x%X \n",next_cell); |
1596 | 326 |
327 ++next_cell; | |
328 if(next_cell>=d->cur_pgc->nr_of_cells) return -1; // EOF | |
329 if( d->cur_pgc->cell_playback[next_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK ){ | |
330 next_cell+=dvd_angle; | |
331 if(next_cell>=d->cur_pgc->nr_of_cells) return -1; // EOF | |
332 } | |
1616 | 333 mp_msg(MSGT_DVD,MSGL_V, "dvd_next_cell: next3=0x%X \n",next_cell); |
1596 | 334 return next_cell; |
335 } | |
336 | |
337 int dvd_read_sector(dvd_priv_t *d,unsigned char* data){ | |
338 int len; | |
339 | |
340 if(d->packs_left==0){ | |
341 /** | |
342 * If we're not at the end of this cell, we can determine the next | |
343 * VOBU to display using the VOBU_SRI information section of the | |
344 * DSI. Using this value correctly follows the current angle, | |
345 * avoiding the doubled scenes in The Matrix, and makes our life | |
346 * really happy. | |
347 * | |
348 * Otherwise, we set our next address past the end of this cell to | |
349 * force the code above to go to the next cell in the program. | |
350 */ | |
351 if( d->dsi_pack.vobu_sri.next_vobu != SRI_END_OF_CELL ) { | |
352 d->cur_pack= d->dsi_pack.dsi_gi.nv_pck_lbn + | |
353 ( d->dsi_pack.vobu_sri.next_vobu & 0x7fffffff ); | |
354 mp_msg(MSGT_DVD,MSGL_DBG2, "Navi new pos=0x%X \n",d->cur_pack); | |
355 } else { | |
356 // end of cell! find next cell! | |
357 mp_msg(MSGT_DVD,MSGL_V, "--- END OF CELL !!! ---\n"); | |
358 d->cur_pack=d->cell_last_pack+1; | |
359 } | |
360 } | |
361 | |
362 read_next: | |
363 | |
364 if(d->cur_pack>d->cell_last_pack){ | |
365 // end of cell! | |
366 int next=dvd_next_cell(d); | |
367 if(next>=0){ | |
368 d->cur_cell=next; | |
369 | |
1615 | 370 // if( d->cur_pgc->cell_playback[d->cur_cell].block_type |
371 // == BLOCK_TYPE_ANGLE_BLOCK ) d->cur_cell+=dvd_angle; | |
1596 | 372 d->cur_pack = d->cur_pgc->cell_playback[ d->cur_cell ].first_sector; |
373 d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector; | |
374 mp_msg(MSGT_DVD,MSGL_V, "DVD next cell: %d pack: 0x%X-0x%X \n",d->cur_cell,d->cur_pack,d->cell_last_pack); | |
375 | |
376 } else return -1; // EOF | |
377 } | |
378 | |
379 len = DVDReadBlocks( d->title, d->cur_pack, 1, data ); | |
380 if(!len) return -1; //error | |
381 | |
382 if(data[38]==0 && data[39]==0 && data[40]==1 && data[41]==0xBF && | |
383 data[1024]==0 && data[1025]==0 && data[1026]==1 && data[1027]==0xBF){ | |
384 // found a Navi packet!!! | |
1875 | 385 #if LIBDVDREAD_VERSION >= DVDREAD_VERSION(0,9,0) |
386 navRead_DSI( &d->dsi_pack, &(data[ DSI_START_BYTE ]) ); | |
387 #else | |
1596 | 388 navRead_DSI( &d->dsi_pack, &(data[ DSI_START_BYTE ]), sizeof(dsi_t) ); |
1875 | 389 #endif |
1596 | 390 if(d->cur_pack != d->dsi_pack.dsi_gi.nv_pck_lbn ){ |
391 mp_msg(MSGT_DVD,MSGL_V, "Invalid NAVI packet! lba=0x%X navi=0x%X \n", | |
392 d->cur_pack,d->dsi_pack.dsi_gi.nv_pck_lbn); | |
393 } else { | |
394 // process! | |
395 d->packs_left = d->dsi_pack.dsi_gi.vobu_ea; | |
396 mp_msg(MSGT_DVD,MSGL_DBG2, "Found NAVI packet! lba=0x%X len=%d \n",d->cur_pack,d->packs_left); | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
397 if(d->angle_seek){ |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
398 int skip=d->dsi_pack.sml_agli.data[dvd_angle].address; |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
399 if(skip) d->cur_pack=d->dsi_pack.dsi_gi.nv_pck_lbn+skip; |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
400 d->angle_seek=0; |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
401 mp_msg(MSGT_DVD,MSGL_V, "Angle-seek synced! skip=%d new_lba=0x%X \n",skip,d->cur_pack); |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
402 } |
1596 | 403 } |
404 ++d->cur_pack; | |
405 goto read_next; | |
406 } | |
407 | |
408 ++d->cur_pack; | |
409 if(d->packs_left>=0) --d->packs_left; | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
410 |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
411 if(d->angle_seek) goto read_next; // searching for Navi packet |
1596 | 412 |
413 return d->cur_pack-1; | |
414 } | |
415 | |
416 void dvd_seek(dvd_priv_t *d,int pos){ | |
417 d->packs_left=-1; | |
418 d->cur_pack=pos; | |
419 | |
420 // check if we stay in current cell (speedup things, and avoid angle skip) | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
421 if(d->cur_pack>d->cell_last_pack || |
1596 | 422 d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector){ |
423 | |
424 // ok, cell change, find the right cell! | |
425 d->cur_cell=0; | |
426 if( d->cur_pgc->cell_playback[d->cur_cell].block_type | |
427 == BLOCK_TYPE_ANGLE_BLOCK ) d->cur_cell+=dvd_angle; | |
428 | |
429 while(1){ | |
430 int next; | |
431 d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector; | |
432 if(d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector){ | |
433 d->cur_pack=d->cur_pgc->cell_playback[ d->cur_cell ].first_sector; | |
434 break; | |
435 } | |
436 if(d->cur_pack<=d->cell_last_pack) break; // ok, we find it! :) | |
437 next=dvd_next_cell(d); | |
438 if(next<0){ | |
439 // d->cur_pack=d->cell_last_pack+1; | |
440 break; // we're after the last cell | |
441 } | |
442 d->cur_cell=next; | |
443 } | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
444 |
1596 | 445 } |
446 | |
447 mp_msg(MSGT_DVD,MSGL_V, "DVD Seek! lba=0x%X cell=%d packs: 0x%X-0x%X \n", | |
448 d->cur_pack,d->cur_cell,d->cur_pgc->cell_playback[ d->cur_cell ].first_sector,d->cell_last_pack); | |
449 | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
450 // if we're in interleaved multi-angle cell, find the right angle chain! |
1596 | 451 // (read Navi block, and use the seamless angle jump table) |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
452 d->angle_seek=1; |
1596 | 453 |
454 } | |
455 | |
456 #endif |