summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-25 14:46:21 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-25 14:46:21 +0000
commit6913dd5d92cbeb14da37815ba7f4310d71c728a9 (patch)
tree2d4234e37d0e9015cb1490df72692c854e09a95f /mplayer.c
parent1fe718fd3caed6eb54c7d480c6cd335b35def0b6 (diff)
downloadmpv-6913dd5d92cbeb14da37815ba7f4310d71c728a9.tar.bz2
mpv-6913dd5d92cbeb14da37815ba7f4310d71c728a9.tar.xz
support for -slang and subtitles in dvdnav; patch by Attila Otvos (oattila chello hu) and me. No palette yet
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21219 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/mplayer.c b/mplayer.c
index d8fcff635f..2c389330e4 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1050,6 +1050,13 @@ void init_vo_spudec(void) {
}
#endif
+#ifdef USE_DVDNAV
+ if (vo_spudec==NULL && stream->type==STREAMTYPE_DVDNAV) {
+ current_module="spudec_init_dvdnav";
+ vo_spudec=spudec_new_scaled(NULL, sh_video->disp_w, sh_video->disp_h);
+ }
+#endif
+
if ((vo_spudec == NULL) && (demuxer->type == DEMUXER_TYPE_MATROSKA) &&
(d_dvdsub->sh != NULL) && (((sh_sub_t *)d_dvdsub->sh)->type == 'v')) {
sh_sub_t *mkv_sh_sub = (sh_sub_t *)d_dvdsub->sh;
@@ -2337,7 +2344,14 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
spudec_reset(vo_spudec);
}
#endif
- if (stream->type != STREAMTYPE_DVD) {
+
+#ifdef USE_DVDNAV
+ if (vo_spudec && stream->type == STREAMTYPE_DVDNAV) {
+ d_dvdsub->id = dvdsub_id;
+ spudec_reset(vo_spudec);
+ }
+#endif
+ if (stream->type != STREAMTYPE_DVD && stream->type != STREAMTYPE_DVDNAV) {
int i = 0;
for (d_dvdsub->id = 0; d_dvdsub->id < MAX_S_STREAMS; d_dvdsub->id++) {
if (demuxer->s_streams[d_dvdsub->id]) {
@@ -2365,7 +2379,7 @@ static int mp_property_sub(m_option_t* prop,int action,void* arg) {
if(vo_spudec) vo_osd_changed(OSDTYPE_SPU);
}
#ifdef USE_DVDREAD
- if (vo_spudec && stream->type == STREAMTYPE_DVD && dvdsub_id < 0 && reset_spu) {
+ if (vo_spudec && (stream->type == STREAMTYPE_DVD || stream->type == STREAMTYPE_DVDNAV) && dvdsub_id < 0 && reset_spu) {
dvdsub_id = -2;
d_dvdsub->id = dvdsub_id;
spudec_reset(vo_spudec);
@@ -4156,6 +4170,18 @@ if(stream->type==STREAMTYPE_DVD){
}
#endif
+#ifdef USE_DVDNAV
+if(stream->type==STREAMTYPE_DVDNAV){
+ current_module="dvdnav lang->id";
+ if(dvdsub_lang && dvdsub_id==-2) dvdsub_id=-1;
+ if(dvdsub_lang && dvdsub_id==-1) dvdsub_id=dvdnav_sid_from_lang(stream,dvdsub_lang);
+ // setup global sub numbering
+ global_sub_indices[SUB_SOURCE_DEMUX] = global_sub_size; // the global # of the first demux-specific sub.
+ global_sub_size += dvdnav_number_of_subs(stream);
+ current_module=NULL;
+}
+#endif
+
// CACHE2: initial prefill: 20% later: 5% (should be set by -cacheopts)
goto_enable_cache:
if(stream_cache_size>0){
@@ -4254,7 +4280,7 @@ if(!demuxer)
}
inited_flags|=INITED_DEMUXER;
-if (stream->type != STREAMTYPE_DVD) {
+if (stream->type != STREAMTYPE_DVD && stream->type != STREAMTYPE_DVDNAV) {
int i;
// setup global sub numbering
global_sub_indices[SUB_SOURCE_DEMUX] = global_sub_size; // the global # of the first demux-specific sub.
@@ -4368,7 +4394,7 @@ demux_info_print(demuxer);
//================== Read SUBTITLES (DVD & TEXT) ==========================
if(vo_spudec==NULL && sh_video &&
- (stream->type==STREAMTYPE_DVD || d_dvdsub->id >= 0)){
+ (stream->type==STREAMTYPE_DVD || stream->type == STREAMTYPE_DVDNAV || d_dvdsub->id >= 0)){
init_vo_spudec();
}