mirror of
https://github.com/mpv-player/mpv
synced 2025-01-20 21:07:29 +01:00
For a request by Gabu, i've cut & fix a part of Joey's dvd aid switching
patch, to always use the first audio track of DVD, unless -alang or -aid is used. I think it will be almost always teh id 128. (actual number comes from the .IFO) (reported ok - Gabu) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10551 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8875fde659
commit
e2e2d40437
@ -618,7 +618,8 @@ int dvd_chapter_from_cell(dvd_priv_t* dvd,int title,int cell)
|
||||
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){
|
||||
if(lang){
|
||||
while(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){
|
||||
@ -631,7 +632,8 @@ int code,i;
|
||||
lang+=2; while (lang[0]==',' || lang[0]==' ') ++lang;
|
||||
}
|
||||
mp_msg(MSGT_OPEN,MSGL_WARN,"No matching DVD audio language found!\n");
|
||||
return -1;
|
||||
}
|
||||
return d->nr_of_channels ? d->audio_streams[0].id : -1;
|
||||
}
|
||||
|
||||
int dvd_sid_from_lang(stream_t *stream, unsigned char* lang){
|
||||
|
@ -1319,7 +1319,7 @@ if(stream_dump_type==5){
|
||||
#ifdef USE_DVDREAD
|
||||
if(stream->type==STREAMTYPE_DVD){
|
||||
current_module="dvd lang->id";
|
||||
if(audio_lang && audio_id==-1) audio_id=dvd_aid_from_lang(stream,audio_lang);
|
||||
if(audio_id==-1) audio_id=dvd_aid_from_lang(stream,audio_lang);
|
||||
if(dvdsub_lang && dvdsub_id==-1) dvdsub_id=dvd_sid_from_lang(stream,dvdsub_lang);
|
||||
current_module=NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user