changeset 12351:af557de9daee

Leave the subs uninitialized and not "forcefully off" if the user hasn't chosen a stream with -sid. If he used -slang then we need the comment packet which might be found after demux_ogg_open has finished.
author mosu
date Thu, 29 Apr 2004 21:01:09 +0000
parents b8465343c991
children 2e0a4b32e139
files libmpdemux/demux_ogg.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c	Thu Apr 29 16:48:56 2004 +0000
+++ b/libmpdemux/demux_ogg.c	Thu Apr 29 21:01:09 2004 +0000
@@ -961,9 +961,12 @@
     demuxer->audio->id = -2;
   else
     demuxer->audio->id = audio_id;
-  if(!n_text || (text_id < 0))
+  /* Disable the subs only if there are no text streams at all.
+     Otherwise the stream to display might be chosen later when the comment
+     packet is encountered and the user used -slang instead of -sid. */
+  if(!n_text)
     demuxer->sub->id = -2;
-  else
+  else if (text_id >= 0)
     demuxer->sub->id = text_id;
 
   ogg_d->final_granulepos=0;