dvd language->aid/sid functions

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3754 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-12-26 00:16:09 +00:00
parent 1a9005e601
commit 6c60debbb5
2 changed files with 41 additions and 2 deletions

View File

@ -261,7 +261,7 @@ if(dvd_title){
tmp,
d->audio_streams[d->nr_of_channels].id
);
d->nr_of_channels++;
}
}
@ -403,9 +403,45 @@ tv_err:
}
#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;

View File

@ -203,6 +203,9 @@ typedef struct {
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