summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ogg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/demux_ogg.c')
-rw-r--r--libmpdemux/demux_ogg.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index d26381df27..c885358834 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -116,6 +116,7 @@ typedef struct ogg_stream {
int theora;
int flac;
int text;
+ int id;
} ogg_stream_t;
typedef struct ogg_demuxer {
@@ -150,6 +151,7 @@ extern int index_mode;
extern char *dvdsub_lang, *audio_lang;
extern int dvdsub_id;
+extern int demux_aid_vid_mismatch;
//-------- subtitle support - should be moved to decoder layer, and queue
// - subtitles up in demuxer buffer...
@@ -448,6 +450,13 @@ static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os, int id, vor
else if (!strncasecmp(*cmt, "LANGUAGE=", 9))
{
val = *cmt + 9;
+ if (identify)
+ {
+ if (ogg_d->subs[id].text)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_SID_%d_LANG=%s\n", ogg_d->subs[id].id, val);
+ else if (id != d->video->id)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AID_%d_LANG=%s\n", ogg_d->subs[id].id, val);
+ }
// copy this language name into the array
index = demux_ogg_sub_reverse_id(d, id);
if (index >= 0) {
@@ -797,11 +806,16 @@ int demux_ogg_open(demuxer_t* demuxer) {
sh_a = NULL;
sh_v = NULL;
+ demux_aid_vid_mismatch = 1; // don't identify in new_sh_* since ids don't match
+
// Check for Vorbis
if(pack.bytes >= 7 && ! strncmp(&pack.packet[1],"vorbis", 6) ) {
sh_a = new_sh_audio(demuxer,ogg_d->num_sub);
sh_a->format = 0xFFFE;
ogg_d->subs[ogg_d->num_sub].vorbis = 1;
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio);
+ ogg_d->subs[ogg_d->num_sub].id = n_audio;
n_audio++;
mp_msg(MSGT_DEMUX,MSGL_V,"Ogg : stream %d is vorbis\n",ogg_d->num_sub);
@@ -839,6 +853,9 @@ int demux_ogg_open(demuxer_t* demuxer) {
sh_v->bih->biWidth*sh_v->bih->biHeight);
ogg_d->subs[ogg_d->num_sub].samplerate = sh_v->fps;
ogg_d->subs[ogg_d->num_sub].theora = 1;
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_ID=%d\n", n_video);
+ ogg_d->subs[ogg_d->num_sub].id = n_video;
n_video++;
mp_msg(MSGT_DEMUX,MSGL_V,
"Ogg : stream %d is theora v%i.%i.%i %i:%i, %.3f FPS,"
@@ -856,6 +873,9 @@ int demux_ogg_open(demuxer_t* demuxer) {
} else if (pack.bytes >= 4 && !strncmp (&pack.packet[0], "fLaC", 4)) {
sh_a = new_sh_audio(demuxer,ogg_d->num_sub);
sh_a->format = mmioFOURCC('f', 'L', 'a', 'C');
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio);
+ ogg_d->subs[ogg_d->num_sub].id = n_audio;
n_audio++;
ogg_d->subs[ogg_d->num_sub].flac = 1;
sh_a->wf = NULL;
@@ -883,6 +903,9 @@ int demux_ogg_open(demuxer_t* demuxer) {
sh_v->bih->biSizeImage=(sh_v->bih->biBitCount>>3)*sh_v->bih->biWidth*sh_v->bih->biHeight;
ogg_d->subs[ogg_d->num_sub].samplerate = sh_v->fps;
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_ID=%d\n", n_video);
+ ogg_d->subs[ogg_d->num_sub].id = n_video;
n_video++;
mp_msg(MSGT_DEMUX,MSGL_V,"Ogg stream %d is video (old hdr)\n",ogg_d->num_sub);
if(verbose>0) print_video_header(sh_v->bih);
@@ -904,6 +927,9 @@ int demux_ogg_open(demuxer_t* demuxer) {
memcpy(sh_a->wf+sizeof(WAVEFORMATEX),pack.packet+142,extra_size);
ogg_d->subs[ogg_d->num_sub].samplerate = sh_a->samplerate; // * sh_a->channels;
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio);
+ ogg_d->subs[ogg_d->num_sub].id = n_audio;
n_audio++;
mp_msg(MSGT_DEMUX,MSGL_V,"Ogg stream %d is audio (old hdr)\n",ogg_d->num_sub);
if(verbose>0) print_wave_header(sh_a->wf);
@@ -932,6 +958,9 @@ int demux_ogg_open(demuxer_t* demuxer) {
sh_v->bih->biSizeImage=(sh_v->bih->biBitCount>>3)*sh_v->bih->biWidth*sh_v->bih->biHeight;
ogg_d->subs[ogg_d->num_sub].samplerate= sh_v->fps;
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_VIDEO_ID=%d\n", n_video);
+ ogg_d->subs[ogg_d->num_sub].id = n_video;
n_video++;
mp_msg(MSGT_DEMUX,MSGL_V,"Ogg stream %d is video (new hdr)\n",ogg_d->num_sub);
if(verbose>0) print_video_header(sh_v->bih);
@@ -955,6 +984,9 @@ int demux_ogg_open(demuxer_t* demuxer) {
memcpy(sh_a->wf+sizeof(WAVEFORMATEX),st+1,extra_size);
ogg_d->subs[ogg_d->num_sub].samplerate = sh_a->samplerate; // * sh_a->channels;
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", n_audio);
+ ogg_d->subs[ogg_d->num_sub].id = n_audio;
n_audio++;
mp_msg(MSGT_DEMUX,MSGL_V,"Ogg stream %d is audio (new hdr)\n",ogg_d->num_sub);
if(verbose>0) print_wave_header(sh_a->wf);
@@ -964,6 +996,9 @@ int demux_ogg_open(demuxer_t* demuxer) {
mp_msg(MSGT_DEMUX, MSGL_V, "Ogg stream %d is text\n", ogg_d->num_sub);
ogg_d->subs[ogg_d->num_sub].samplerate= get_uint64(&st->time_unit)/10;
ogg_d->subs[ogg_d->num_sub].text = 1;
+ if (identify)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", ogg_d->n_text);
+ ogg_d->subs[ogg_d->num_sub].id = ogg_d->n_text;
if (demuxer->sub->id == ogg_d->n_text)
text_id = ogg_d->num_sub;
ogg_d->n_text++;