changeset 17286:b0046966ab82

don't reset dvdsub->id unless -slang is specified; assign default sub stream id when demux->sub->id is -1 (autodetect)
author nicodvb
date Mon, 02 Jan 2006 20:40:25 +0000
parents 993b6c4fa604
children 4a8dbeb06bad
files libmpdemux/demux_mpg.c mplayer.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mpg.c	Mon Jan 02 13:12:29 2006 +0000
+++ b/libmpdemux/demux_mpg.c	Mon Jan 02 20:40:25 2006 +0000
@@ -36,6 +36,7 @@
   int a_stream_ids[MAX_A_STREAMS];
 } mpg_demuxer_t;
 
+extern char* dvdsub_lang;
 static int mpeg_pts_error=0;
 
 static int parse_psm(demuxer_t *demux, int len) {
@@ -293,6 +294,10 @@
             demux->s_streams[aid]=1;
         }
 
+        if(demux->sub->id > -1)
+          demux->sub->id &= 0x1F;
+        if(!dvdsub_lang && demux->sub->id == -1)
+          demux->sub->id = aid;
         if(demux->sub->id==aid){
             ds=demux->sub;
         }
--- a/mplayer.c	Mon Jan 02 13:12:29 2006 +0000
+++ b/mplayer.c	Mon Jan 02 20:40:25 2006 +0000
@@ -3794,8 +3794,10 @@
         vo_sub_last = vo_sub = NULL;
 #endif
         vobsub_id = -1;
+	if(dvdsub_lang) {
         dvdsub_id = -1;
         if (d_dvdsub) d_dvdsub->id = -1;
+	}
 
         // be careful!
         // if sub_changed is till on but subdata's been reset, bad things happen.