summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ogg.c
diff options
context:
space:
mode:
authorjoey <joey@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-08-22 18:47:48 +0000
committerjoey <joey@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-08-22 18:47:48 +0000
commit1b8e3babb84d8b5619e7eeae3c84276614ba5958 (patch)
tree2b6d456360b35b39ef208646cbcd5274c705a09d /libmpdemux/demux_ogg.c
parent97aeb8861fd019e2a4a70012323f40803b7f9544 (diff)
downloadmpv-1b8e3babb84d8b5619e7eeae3c84276614ba5958.tar.bz2
mpv-1b8e3babb84d8b5619e7eeae3c84276614ba5958.tar.xz
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 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13090 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_ogg.c')
-rw-r--r--libmpdemux/demux_ogg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 5b3a656519..530a920fe8 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -655,12 +655,18 @@ void demux_ogg_scan_stream(demuxer_t* demuxer) {
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 @@ int demux_ogg_open(demuxer_t* demuxer) {
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