Mercurial > mplayer.hg
comparison mplayer.c @ 21203:235a8e71ed6f
support for -slang and subtitles in dvdnav; patch by Attila Otvos (oattila chello hu) and me. No palette yet
author | nicodvb |
---|---|
date | Sat, 25 Nov 2006 14:46:21 +0000 |
parents | c7b5dd2b2291 |
children | 8258747951d7 |
comparison
equal
deleted
inserted
replaced
21202:8ed444639678 | 21203:235a8e71ed6f |
---|---|
1045 #ifdef USE_DVDREAD | 1045 #ifdef USE_DVDREAD |
1046 if (vo_spudec==NULL && stream->type==STREAMTYPE_DVD) { | 1046 if (vo_spudec==NULL && stream->type==STREAMTYPE_DVD) { |
1047 current_module="spudec_init_dvdread"; | 1047 current_module="spudec_init_dvdread"; |
1048 vo_spudec=spudec_new_scaled(((dvd_priv_t *)(stream->priv))->cur_pgc->palette, | 1048 vo_spudec=spudec_new_scaled(((dvd_priv_t *)(stream->priv))->cur_pgc->palette, |
1049 sh_video->disp_w, sh_video->disp_h); | 1049 sh_video->disp_w, sh_video->disp_h); |
1050 } | |
1051 #endif | |
1052 | |
1053 #ifdef USE_DVDNAV | |
1054 if (vo_spudec==NULL && stream->type==STREAMTYPE_DVDNAV) { | |
1055 current_module="spudec_init_dvdnav"; | |
1056 vo_spudec=spudec_new_scaled(NULL, sh_video->disp_w, sh_video->disp_h); | |
1050 } | 1057 } |
1051 #endif | 1058 #endif |
1052 | 1059 |
1053 if ((vo_spudec == NULL) && (demuxer->type == DEMUXER_TYPE_MATROSKA) && | 1060 if ((vo_spudec == NULL) && (demuxer->type == DEMUXER_TYPE_MATROSKA) && |
1054 (d_dvdsub->sh != NULL) && (((sh_sub_t *)d_dvdsub->sh)->type == 'v')) { | 1061 (d_dvdsub->sh != NULL) && (((sh_sub_t *)d_dvdsub->sh)->type == 'v')) { |
2335 if (vo_spudec && stream->type == STREAMTYPE_DVD) { | 2342 if (vo_spudec && stream->type == STREAMTYPE_DVD) { |
2336 d_dvdsub->id = dvdsub_id; | 2343 d_dvdsub->id = dvdsub_id; |
2337 spudec_reset(vo_spudec); | 2344 spudec_reset(vo_spudec); |
2338 } | 2345 } |
2339 #endif | 2346 #endif |
2340 if (stream->type != STREAMTYPE_DVD) { | 2347 |
2348 #ifdef USE_DVDNAV | |
2349 if (vo_spudec && stream->type == STREAMTYPE_DVDNAV) { | |
2350 d_dvdsub->id = dvdsub_id; | |
2351 spudec_reset(vo_spudec); | |
2352 } | |
2353 #endif | |
2354 if (stream->type != STREAMTYPE_DVD && stream->type != STREAMTYPE_DVDNAV) { | |
2341 int i = 0; | 2355 int i = 0; |
2342 for (d_dvdsub->id = 0; d_dvdsub->id < MAX_S_STREAMS; d_dvdsub->id++) { | 2356 for (d_dvdsub->id = 0; d_dvdsub->id < MAX_S_STREAMS; d_dvdsub->id++) { |
2343 if (demuxer->s_streams[d_dvdsub->id]) { | 2357 if (demuxer->s_streams[d_dvdsub->id]) { |
2344 if (i == dvdsub_id) break; | 2358 if (i == dvdsub_id) break; |
2345 i++; | 2359 i++; |
2363 } else { // off | 2377 } else { // off |
2364 vo_osd_changed(OSDTYPE_SUBTITLE); | 2378 vo_osd_changed(OSDTYPE_SUBTITLE); |
2365 if(vo_spudec) vo_osd_changed(OSDTYPE_SPU); | 2379 if(vo_spudec) vo_osd_changed(OSDTYPE_SPU); |
2366 } | 2380 } |
2367 #ifdef USE_DVDREAD | 2381 #ifdef USE_DVDREAD |
2368 if (vo_spudec && stream->type == STREAMTYPE_DVD && dvdsub_id < 0 && reset_spu) { | 2382 if (vo_spudec && (stream->type == STREAMTYPE_DVD || stream->type == STREAMTYPE_DVDNAV) && dvdsub_id < 0 && reset_spu) { |
2369 dvdsub_id = -2; | 2383 dvdsub_id = -2; |
2370 d_dvdsub->id = dvdsub_id; | 2384 d_dvdsub->id = dvdsub_id; |
2371 spudec_reset(vo_spudec); | 2385 spudec_reset(vo_spudec); |
2372 } | 2386 } |
2373 #endif | 2387 #endif |
4154 global_sub_size += dvd_number_of_subs(stream); | 4168 global_sub_size += dvd_number_of_subs(stream); |
4155 current_module=NULL; | 4169 current_module=NULL; |
4156 } | 4170 } |
4157 #endif | 4171 #endif |
4158 | 4172 |
4173 #ifdef USE_DVDNAV | |
4174 if(stream->type==STREAMTYPE_DVDNAV){ | |
4175 current_module="dvdnav lang->id"; | |
4176 if(dvdsub_lang && dvdsub_id==-2) dvdsub_id=-1; | |
4177 if(dvdsub_lang && dvdsub_id==-1) dvdsub_id=dvdnav_sid_from_lang(stream,dvdsub_lang); | |
4178 // setup global sub numbering | |
4179 global_sub_indices[SUB_SOURCE_DEMUX] = global_sub_size; // the global # of the first demux-specific sub. | |
4180 global_sub_size += dvdnav_number_of_subs(stream); | |
4181 current_module=NULL; | |
4182 } | |
4183 #endif | |
4184 | |
4159 // CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts) | 4185 // CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts) |
4160 goto_enable_cache: | 4186 goto_enable_cache: |
4161 if(stream_cache_size>0){ | 4187 if(stream_cache_size>0){ |
4162 current_module="enable_cache"; | 4188 current_module="enable_cache"; |
4163 if(!stream_enable_cache(stream,stream_cache_size*1024, | 4189 if(!stream_enable_cache(stream,stream_cache_size*1024, |
4252 #endif | 4278 #endif |
4253 goto goto_next_file; | 4279 goto goto_next_file; |
4254 } | 4280 } |
4255 inited_flags|=INITED_DEMUXER; | 4281 inited_flags|=INITED_DEMUXER; |
4256 | 4282 |
4257 if (stream->type != STREAMTYPE_DVD) { | 4283 if (stream->type != STREAMTYPE_DVD && stream->type != STREAMTYPE_DVDNAV) { |
4258 int i; | 4284 int i; |
4259 // setup global sub numbering | 4285 // setup global sub numbering |
4260 global_sub_indices[SUB_SOURCE_DEMUX] = global_sub_size; // the global # of the first demux-specific sub. | 4286 global_sub_indices[SUB_SOURCE_DEMUX] = global_sub_size; // the global # of the first demux-specific sub. |
4261 for (i = 0; i < MAX_S_STREAMS; i++) | 4287 for (i = 0; i < MAX_S_STREAMS; i++) |
4262 if (demuxer->s_streams[i]) | 4288 if (demuxer->s_streams[i]) |
4366 /* display clip info */ | 4392 /* display clip info */ |
4367 demux_info_print(demuxer); | 4393 demux_info_print(demuxer); |
4368 | 4394 |
4369 //================== Read SUBTITLES (DVD & TEXT) ========================== | 4395 //================== Read SUBTITLES (DVD & TEXT) ========================== |
4370 if(vo_spudec==NULL && sh_video && | 4396 if(vo_spudec==NULL && sh_video && |
4371 (stream->type==STREAMTYPE_DVD || d_dvdsub->id >= 0)){ | 4397 (stream->type==STREAMTYPE_DVD || stream->type == STREAMTYPE_DVDNAV || d_dvdsub->id >= 0)){ |
4372 init_vo_spudec(); | 4398 init_vo_spudec(); |
4373 } | 4399 } |
4374 | 4400 |
4375 // Apply current settings for forced subs | 4401 // Apply current settings for forced subs |
4376 if (vo_spudec!=NULL) | 4402 if (vo_spudec!=NULL) |