mirror of https://github.com/mpv-player/mpv
add subtitle language detect.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3049 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
7fe0a4e7da
commit
b2a38b3ba0
|
@ -208,7 +208,6 @@ if(dvd_title){
|
||||||
/**
|
/**
|
||||||
* Check number of audio channels and types
|
* Check number of audio channels and types
|
||||||
*/
|
*/
|
||||||
// fprintf( stderr,"[open] nr_audio streams: %d\n",vts_file->vtsi_mat->nr_of_vts_audio_streams );
|
|
||||||
{
|
{
|
||||||
int ac3aid = 128;
|
int ac3aid = 128;
|
||||||
int mpegaid = 0;
|
int mpegaid = 0;
|
||||||
|
@ -264,7 +263,41 @@ if(dvd_title){
|
||||||
d->nr_of_channels++;
|
d->nr_of_channels++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mp_msg(MSGT_OPEN,MSGL_V,"[open] %d audio channel found on disk.\n",d->nr_of_channels );
|
mp_msg(MSGT_OPEN,MSGL_V,"[open] number of audio channels on disk: %d.\n",d->nr_of_channels );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check number of subtitles and language
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
d->nr_of_subtitles=0;
|
||||||
|
for ( i=0;i<32;i++ )
|
||||||
|
if ( vts_file->vts_pgcit->pgci_srp[0].pgc->subp_control[i] & 0x80000000 )
|
||||||
|
{
|
||||||
|
subp_attr_t * subtitle = &vts_file->vtsi_mat->vts_subp_attr[i];
|
||||||
|
int language = 0;
|
||||||
|
char tmp[] = "unknown";
|
||||||
|
|
||||||
|
if ( subtitle->type == 1 )
|
||||||
|
{
|
||||||
|
language=subtitle->lang_code;
|
||||||
|
tmp[0]=language>>8;
|
||||||
|
tmp[1]=language&0xff;
|
||||||
|
tmp[2]=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
d->subtitles[ d->nr_of_subtitles ].language=language;
|
||||||
|
d->subtitles[ d->nr_of_subtitles ].id=d->nr_of_subtitles;
|
||||||
|
|
||||||
|
mp_msg(MSGT_OPEN,MSGL_V,"[open] subtitle ( sid ): %d language: %s\n",
|
||||||
|
d->nr_of_subtitles,
|
||||||
|
tmp
|
||||||
|
);
|
||||||
|
d->nr_of_subtitles++;
|
||||||
|
}
|
||||||
|
mp_msg(MSGT_OPEN,MSGL_V,"[open] number of subtitles on disk: %d\n",d->nr_of_subtitles );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -177,6 +177,11 @@ typedef struct {
|
||||||
int language;
|
int language;
|
||||||
} audio_stream_t;
|
} audio_stream_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int id; // 0 - 31
|
||||||
|
int language;
|
||||||
|
} subtitle_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
dvd_reader_t *dvd;
|
dvd_reader_t *dvd;
|
||||||
dvd_file_t *title;
|
dvd_file_t *title;
|
||||||
|
@ -196,6 +201,9 @@ typedef struct {
|
||||||
// audio datas
|
// audio datas
|
||||||
int nr_of_channels;
|
int nr_of_channels;
|
||||||
audio_stream_t audio_streams[8];
|
audio_stream_t audio_streams[8];
|
||||||
|
// subtitles
|
||||||
|
int nr_of_subtitles;
|
||||||
|
subtitle_t subtitles[32];
|
||||||
} dvd_priv_t;
|
} dvd_priv_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue