[Mplayer-cvslog] CVS: main/libmpdemux open.c,1.24,1.25 stream.h,1.15,1.16
Zoltan Ponekker
pontscho at mplayer.dev.hu
Wed Nov 21 11:31:01 CET 2001
Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv3327/libmpdemux
Modified Files:
open.c stream.h
Log Message:
add subtitle language detect.
Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- open.c 21 Nov 2001 02:49:01 -0000 1.24
+++ open.c 21 Nov 2001 10:30:59 -0000 1.25
@@ -208,7 +208,6 @@
/**
* 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 mpegaid = 0;
@@ -264,7 +263,41 @@
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 );
}
/**
Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- stream.h 20 Nov 2001 22:21:20 -0000 1.15
+++ stream.h 21 Nov 2001 10:30:59 -0000 1.16
@@ -178,6 +178,11 @@
} audio_stream_t;
typedef struct {
+ int id; // 0 - 31
+ int language;
+} subtitle_t;
+
+typedef struct {
dvd_reader_t *dvd;
dvd_file_t *title;
ifo_handle_t *vmg_file;
@@ -196,6 +201,9 @@
// audio datas
int nr_of_channels;
audio_stream_t audio_streams[8];
+// subtitles
+ int nr_of_subtitles;
+ subtitle_t subtitles[32];
} dvd_priv_t;
#endif
More information about the MPlayer-cvslog
mailing list