[Mplayer-cvslog] CVS: main/libmpdemux stream.h,1.20,1.21 open.c,1.27,1.28

Arpi of Ize arpi at mplayer.dev.hu
Wed Dec 26 01:16:11 CET 2001


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv17781

Modified Files:
	stream.h open.c 
Log Message:
dvd language->aid/sid functions

Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- stream.h	25 Dec 2001 23:31:30 -0000	1.20
+++ stream.h	26 Dec 2001 00:16:09 -0000	1.21
@@ -203,6 +203,9 @@
   stream_language_t subtitles[32];
 } dvd_priv_t;
 
+int dvd_aid_from_lang(stream_t *stream, unsigned char* lang);
+int dvd_sid_from_lang(stream_t *stream, unsigned char* lang);
+
 #endif
 							    
 #endif // __STREAM_H

Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- open.c	19 Dec 2001 09:02:52 -0000	1.27
+++ open.c	26 Dec 2001 00:16:09 -0000	1.28
@@ -261,7 +261,7 @@
 	    tmp,
 	    d->audio_streams[d->nr_of_channels].id
 	    );
-
+	    
 	  d->nr_of_channels++;
 	 }
       }
@@ -403,8 +403,44 @@
 
 }
 
-
 #ifdef USE_DVDREAD
+
+int dvd_aid_from_lang(stream_t *stream, unsigned char* lang){
+dvd_priv_t *d=stream->priv;
+int code,i;
+  while(lang && strlen(lang)>=2){
+    code=lang[1]|(lang[0]<<8);
+    for(i=0;i<d->nr_of_channels;i++){
+	if(d->audio_streams[i].language==code){
+	    mp_msg(MSGT_OPEN,MSGL_INFO,"Selected DVD audio channel: %d language: %c%c\n",
+		d->audio_streams[i].id, lang[0],lang[1]);
+	    return d->audio_streams[i].id;
+	}
+//	printf("%X != %X  (%c%c)\n",code,d->audio_streams[i].language,lang[0],lang[1]);
+    }
+    lang+=2; while (lang[0]==',' || lang[0]==' ') ++lang;
+  }
+  mp_msg(MSGT_OPEN,MSGL_INFO,"No matching DVD audio language found!\n");
+  return -1;
+}
+
+int dvd_sid_from_lang(stream_t *stream, unsigned char* lang){
+dvd_priv_t *d=stream->priv;
+int code,i;
+  while(lang && strlen(lang)>=2){
+    code=lang[1]|(lang[0]<<8);
+    for(i=0;i<d->nr_of_subtitles;i++){
+	if(d->subtitles[i].language==code){
+	    mp_msg(MSGT_OPEN,MSGL_INFO,"Selected DVD subtitle channel: %d language: %c%c\n",
+		d->subtitles[i].id, lang[0],lang[1]);
+	    return d->subtitles[i].id;
+	}
+    }
+    lang+=2; while (lang[0]==',' || lang[0]==' ') ++lang;
+  }
+  mp_msg(MSGT_OPEN,MSGL_INFO,"No matching DVD subtitle language found!\n");
+  return -1;
+}
 
 static int dvd_next_cell(dvd_priv_t *d){
     int next_cell=d->cur_cell;




More information about the MPlayer-cvslog mailing list