[Mplayer-cvslog] CVS: main/libmpdemux demux_ogg.c, 1.54, 1.55 open.c, 1.98, 1.99 stream.h, 1.68, 1.69

Joey Parrish CVS syncmail at mplayerhq.hu
Sun Aug 22 20:47:50 CEST 2004


CVS change done by Joey Parrish CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv15657/libmpdemux

Modified Files:
	demux_ogg.c open.c stream.h 
Log Message:
moved combined vobsub_lang into sub_select
add support for dvd subs and ogg subs into sub_select
document sub_select
vobsub_lang left as a link to sub_select for backwards compatibility


Index: demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- demux_ogg.c	28 Jul 2004 12:40:35 -0000	1.54
+++ demux_ogg.c	22 Aug 2004 18:47:48 -0000	1.55
@@ -655,12 +655,18 @@
 extern void print_wave_header(WAVEFORMATEX *h);
 extern void print_video_header(BITMAPINFOHEADER *h);
 
+static int n_text = 0;
+static int *text_ids = NULL;
+
+int demux_ogg_num_subs() { return n_text; }
+int demux_ogg_sub_id(int index) { return (index < 0) ? index : text_ids[index]; }
+
 /// Open an ogg physical stream
 int demux_ogg_open(demuxer_t* demuxer) {
   ogg_demuxer_t* ogg_d;
   stream_t *s;
   char* buf;
-  int np,s_no, n_audio = 0, n_video = 0, n_text = 0;
+  int np,s_no, n_audio = 0, n_video = 0;
   int audio_id = -1, video_id = -1, text_id = -1;
   ogg_sync_state* sync;
   ogg_page* page;
@@ -902,6 +908,8 @@
           if (demuxer->sub->id == n_text)
             text_id = ogg_d->num_sub;
           n_text++;
+          text_ids = (int *)realloc(text_ids, sizeof(int) * n_text);
+          text_ids[n_text - 1] = ogg_d->num_sub;
           demux_ogg_init_sub();
 	//// Unknown header type
       } else

Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- open.c	25 Jun 2004 15:19:11 -0000	1.98
+++ open.c	22 Aug 2004 18:47:48 -0000	1.99
@@ -636,6 +636,25 @@
 return d->nr_of_channels ? d->audio_streams[0].id : -1;
 }
 
+int dvd_number_of_subs(stream_t *stream)
+{
+  dvd_priv_t *d;
+  if (!stream) return -1;
+  d = stream->priv;
+  if (!d) return -1;
+  return d->nr_of_subtitles;
+}
+
+int dvd_lang_from_sid(stream_t *stream, int id)
+{
+  dvd_priv_t *d;
+  if (!stream) return 0;
+  d = stream->priv;
+  if (!d) return 0;
+  if (id >= d->nr_of_subtitles) return 0;
+  return d->subtitles[id].language;
+}
+
 int dvd_sid_from_lang(stream_t *stream, unsigned char* lang){
 dvd_priv_t *d=stream->priv;
 int code,i;

Index: stream.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- stream.h	13 Mar 2004 16:10:02 -0000	1.68
+++ stream.h	22 Aug 2004 18:47:48 -0000	1.69
@@ -321,6 +321,8 @@
   stream_language_t subtitles[32];
 } dvd_priv_t;
 
+int dvd_number_of_subs(stream_t *stream);
+int dvd_lang_from_sid(stream_t *stream, int id);
 int dvd_aid_from_lang(stream_t *stream, unsigned char* lang);
 int dvd_sid_from_lang(stream_t *stream, unsigned char* lang);
 int dvd_chapter_from_cell(dvd_priv_t *dvd,int title,int cell);




More information about the MPlayer-cvslog mailing list