Mercurial > mplayer.hg
annotate libmpdemux/open.c @ 2841:7ff47d6ae6e9
updated audio and tuner checking
author | alex |
---|---|
date | Sun, 11 Nov 2001 16:28:12 +0000 |
parents | c63562f5f56f |
children | bce9c945b29c |
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" | |
2802 | 75 tvi_handle_t *tv_handler; |
2790 | 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 { | |
2802 | 254 stream = new_stream(-1,STREAMTYPE_TV); |
2790 | 255 tv_handler = tv_begin(); |
256 if (!tv_handler) | |
257 return(NULL); | |
2802 | 258 if (tv_init(tv_handler) == 1) |
259 return(stream); | |
2837 | 260 tv_uninit(tv_handler); |
2802 | 261 return(NULL); |
2790 | 262 } |
263 #endif | |
264 | |
1467 | 265 //============ Open STDIN ============ |
266 if(!strcmp(filename,"-")){ | |
267 // read from stdin | |
1584 | 268 mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN); |
1467 | 269 f=0; // 0=stdin |
270 stream=new_stream(f,STREAMTYPE_STREAM); | |
271 return stream; | |
272 } | |
273 | |
274 #ifdef STREAMING | |
275 url = url_new(filename); | |
276 if(url) { | |
277 (*file_format)=autodetectProtocol( url, &f ); | |
278 if( (*file_format)==DEMUXER_TYPE_UNKNOWN ) { | |
1584 | 279 mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, filename); |
1467 | 280 url_free(url); |
281 return NULL; | |
282 } | |
1899 | 283 f=streaming_start( &url, f, *file_format ); |
2315 | 284 //printf("streaming_start(%d) returned %d\n",*file_format,f); |
1584 | 285 if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, url->url); return NULL; } |
286 mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ConnToServer, url->hostname ); | |
1467 | 287 stream=new_stream(f,STREAMTYPE_STREAM); |
2315 | 288 // return NULL; |
289 return stream; | |
1467 | 290 } |
291 #endif | |
292 | |
293 //============ Open plain FILE ============ | |
294 f=open(filename,O_RDONLY); | |
1584 | 295 if(f<0){ mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);return NULL; } |
1467 | 296 len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET); |
297 if (len == -1) | |
298 perror("Error: lseek failed to obtain video file size"); | |
299 else | |
300 #ifdef _LARGEFILE_SOURCE | |
1567 | 301 mp_msg(MSGT_OPEN,MSGL_V,"File size is %lld bytes\n", (long long)len); |
1467 | 302 #else |
1567 | 303 mp_msg(MSGT_OPEN,MSGL_V,"File size is %u bytes\n", (unsigned int)len); |
1467 | 304 #endif |
305 stream=new_stream(f,STREAMTYPE_FILE); | |
306 stream->end_pos=len; | |
307 return stream; | |
308 | |
309 } | |
1596 | 310 |
311 | |
312 #ifdef USE_DVDREAD | |
313 | |
314 static int dvd_next_cell(dvd_priv_t *d){ | |
315 int next_cell=d->cur_cell; | |
1616 | 316 |
317 mp_msg(MSGT_DVD,MSGL_V, "dvd_next_cell: next1=0x%X \n",next_cell); | |
1596 | 318 |
319 if( d->cur_pgc->cell_playback[ next_cell ].block_type | |
320 == BLOCK_TYPE_ANGLE_BLOCK ) { | |
321 while(next_cell<d->cur_pgc->nr_of_cells){ | |
322 if( d->cur_pgc->cell_playback[next_cell].block_mode | |
323 == BLOCK_MODE_LAST_CELL ) break; | |
324 ++next_cell; | |
325 } | |
326 } | |
1616 | 327 mp_msg(MSGT_DVD,MSGL_V, "dvd_next_cell: next2=0x%X \n",next_cell); |
1596 | 328 |
329 ++next_cell; | |
330 if(next_cell>=d->cur_pgc->nr_of_cells) return -1; // EOF | |
331 if( d->cur_pgc->cell_playback[next_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK ){ | |
332 next_cell+=dvd_angle; | |
333 if(next_cell>=d->cur_pgc->nr_of_cells) return -1; // EOF | |
334 } | |
1616 | 335 mp_msg(MSGT_DVD,MSGL_V, "dvd_next_cell: next3=0x%X \n",next_cell); |
1596 | 336 return next_cell; |
337 } | |
338 | |
339 int dvd_read_sector(dvd_priv_t *d,unsigned char* data){ | |
340 int len; | |
341 | |
342 if(d->packs_left==0){ | |
343 /** | |
344 * If we're not at the end of this cell, we can determine the next | |
345 * VOBU to display using the VOBU_SRI information section of the | |
346 * DSI. Using this value correctly follows the current angle, | |
347 * avoiding the doubled scenes in The Matrix, and makes our life | |
348 * really happy. | |
349 * | |
350 * Otherwise, we set our next address past the end of this cell to | |
351 * force the code above to go to the next cell in the program. | |
352 */ | |
353 if( d->dsi_pack.vobu_sri.next_vobu != SRI_END_OF_CELL ) { | |
354 d->cur_pack= d->dsi_pack.dsi_gi.nv_pck_lbn + | |
355 ( d->dsi_pack.vobu_sri.next_vobu & 0x7fffffff ); | |
356 mp_msg(MSGT_DVD,MSGL_DBG2, "Navi new pos=0x%X \n",d->cur_pack); | |
357 } else { | |
358 // end of cell! find next cell! | |
359 mp_msg(MSGT_DVD,MSGL_V, "--- END OF CELL !!! ---\n"); | |
360 d->cur_pack=d->cell_last_pack+1; | |
361 } | |
362 } | |
363 | |
364 read_next: | |
365 | |
366 if(d->cur_pack>d->cell_last_pack){ | |
367 // end of cell! | |
368 int next=dvd_next_cell(d); | |
369 if(next>=0){ | |
370 d->cur_cell=next; | |
371 | |
1615 | 372 // if( d->cur_pgc->cell_playback[d->cur_cell].block_type |
373 // == BLOCK_TYPE_ANGLE_BLOCK ) d->cur_cell+=dvd_angle; | |
1596 | 374 d->cur_pack = d->cur_pgc->cell_playback[ d->cur_cell ].first_sector; |
375 d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector; | |
376 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); | |
377 | |
378 } else return -1; // EOF | |
379 } | |
380 | |
381 len = DVDReadBlocks( d->title, d->cur_pack, 1, data ); | |
382 if(!len) return -1; //error | |
383 | |
384 if(data[38]==0 && data[39]==0 && data[40]==1 && data[41]==0xBF && | |
385 data[1024]==0 && data[1025]==0 && data[1026]==1 && data[1027]==0xBF){ | |
386 // found a Navi packet!!! | |
1875 | 387 #if LIBDVDREAD_VERSION >= DVDREAD_VERSION(0,9,0) |
388 navRead_DSI( &d->dsi_pack, &(data[ DSI_START_BYTE ]) ); | |
389 #else | |
1596 | 390 navRead_DSI( &d->dsi_pack, &(data[ DSI_START_BYTE ]), sizeof(dsi_t) ); |
1875 | 391 #endif |
1596 | 392 if(d->cur_pack != d->dsi_pack.dsi_gi.nv_pck_lbn ){ |
393 mp_msg(MSGT_DVD,MSGL_V, "Invalid NAVI packet! lba=0x%X navi=0x%X \n", | |
394 d->cur_pack,d->dsi_pack.dsi_gi.nv_pck_lbn); | |
395 } else { | |
396 // process! | |
397 d->packs_left = d->dsi_pack.dsi_gi.vobu_ea; | |
398 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
|
399 if(d->angle_seek){ |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
400 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
|
401 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
|
402 d->angle_seek=0; |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
403 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
|
404 } |
1596 | 405 } |
406 ++d->cur_pack; | |
407 goto read_next; | |
408 } | |
409 | |
410 ++d->cur_pack; | |
411 if(d->packs_left>=0) --d->packs_left; | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
412 |
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
413 if(d->angle_seek) goto read_next; // searching for Navi packet |
1596 | 414 |
415 return d->cur_pack-1; | |
416 } | |
417 | |
418 void dvd_seek(dvd_priv_t *d,int pos){ | |
419 d->packs_left=-1; | |
420 d->cur_pack=pos; | |
421 | |
422 // 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
|
423 if(d->cur_pack>d->cell_last_pack || |
1596 | 424 d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector){ |
425 | |
426 // ok, cell change, find the right cell! | |
427 d->cur_cell=0; | |
428 if( d->cur_pgc->cell_playback[d->cur_cell].block_type | |
429 == BLOCK_TYPE_ANGLE_BLOCK ) d->cur_cell+=dvd_angle; | |
430 | |
431 while(1){ | |
432 int next; | |
433 d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector; | |
434 if(d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector){ | |
435 d->cur_pack=d->cur_pgc->cell_playback[ d->cur_cell ].first_sector; | |
436 break; | |
437 } | |
438 if(d->cur_pack<=d->cell_last_pack) break; // ok, we find it! :) | |
439 next=dvd_next_cell(d); | |
440 if(next<0){ | |
441 // d->cur_pack=d->cell_last_pack+1; | |
442 break; // we're after the last cell | |
443 } | |
444 d->cur_cell=next; | |
445 } | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
446 |
1596 | 447 } |
448 | |
449 mp_msg(MSGT_DVD,MSGL_V, "DVD Seek! lba=0x%X cell=%d packs: 0x%X-0x%X \n", | |
450 d->cur_pack,d->cur_cell,d->cur_pgc->cell_playback[ d->cur_cell ].first_sector,d->cell_last_pack); | |
451 | |
1609
84199d075839
ugly seeking bug fixed, correct multiangle seek implemented
arpi
parents:
1596
diff
changeset
|
452 // if we're in interleaved multi-angle cell, find the right angle chain! |
1596 | 453 // (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
|
454 d->angle_seek=1; |
1596 | 455 |
456 } | |
457 | |
458 #endif |