comparison libmpdemux/demux_mpg.c @ 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 9081ae3a702c
children 0c031c0ba80b
comparison
equal deleted inserted replaced
17285:993b6c4fa604 17286:b0046966ab82
34 unsigned int es_map[0x40]; //es map of stream types (associated to the pes id) from 0xb0 to 0xef 34 unsigned int es_map[0x40]; //es map of stream types (associated to the pes id) from 0xb0 to 0xef
35 int num_a_streams; 35 int num_a_streams;
36 int a_stream_ids[MAX_A_STREAMS]; 36 int a_stream_ids[MAX_A_STREAMS];
37 } mpg_demuxer_t; 37 } mpg_demuxer_t;
38 38
39 extern char* dvdsub_lang;
39 static int mpeg_pts_error=0; 40 static int mpeg_pts_error=0;
40 41
41 static int parse_psm(demuxer_t *demux, int len) { 42 static int parse_psm(demuxer_t *demux, int len) {
42 unsigned char c, id, type; 43 unsigned char c, id, type;
43 unsigned int plen, prog_len, es_map_len; 44 unsigned int plen, prog_len, es_map_len;
291 if(!demux->s_streams[aid]){ 292 if(!demux->s_streams[aid]){
292 mp_msg(MSGT_DEMUX,MSGL_V,"==> Found subtitle: %d\n",aid); 293 mp_msg(MSGT_DEMUX,MSGL_V,"==> Found subtitle: %d\n",aid);
293 demux->s_streams[aid]=1; 294 demux->s_streams[aid]=1;
294 } 295 }
295 296
297 if(demux->sub->id > -1)
298 demux->sub->id &= 0x1F;
299 if(!dvdsub_lang && demux->sub->id == -1)
300 demux->sub->id = aid;
296 if(demux->sub->id==aid){ 301 if(demux->sub->id==aid){
297 ds=demux->sub; 302 ds=demux->sub;
298 } 303 }
299 304
300 } else if((aid & 0xC0) == 0x80 || (aid & 0xE0) == 0x00) { 305 } else if((aid & 0xC0) == 0x80 || (aid & 0xE0) == 0x00) {