[MPlayer-cvslog] r26119 - in trunk: mencoder.c mplayer.c

eugeni subversion at mplayerhq.hu
Fri Feb 29 18:25:45 CET 2008


Author: eugeni
Date: Fri Feb 29 18:25:44 2008
New Revision: 26119

Log:
Demuxer-independent subtitle track selection.


Modified:
   trunk/mencoder.c
   trunk/mplayer.c

Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c	(original)
+++ trunk/mencoder.c	Fri Feb 29 18:25:44 2008
@@ -600,6 +600,18 @@ if(stream->type==STREAMTYPE_DVDNAV){
 	mencoder_exit(1,NULL);
   }
  
+  if (dvdsub_id < 0 && dvdsub_lang)
+    dvdsub_id = demuxer_sub_track_by_lang(demuxer, dvdsub_lang);
+
+  for (i = 0; i < MAX_S_STREAMS; i++) {
+    sh_sub_t *sh = demuxer->s_streams[i];
+    if (sh && sh->sid == dvdsub_id) {
+      demuxer->sub->id = i;
+      demuxer->sub->sh = sh;
+      break;
+    }
+  }
+
   if(dvd_chapter>1) {
     float pts;
     if (demuxer_seek_chapter(demuxer, dvd_chapter-1, 1, &pts, NULL, NULL) >= 0 && pts > -1.0)

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Fri Feb 29 18:25:44 2008
@@ -3444,6 +3444,8 @@ if(mpctx->sh_video) {
 if (mpctx->global_sub_size) {
   // find the best sub to use
   int vobsub_index_id = vobsub_get_index_by_id(vo_vobsub, vobsub_id);
+  if (dvdsub_id < 0 && dvdsub_lang)
+    dvdsub_id = demuxer_sub_track_by_lang(mpctx->demuxer, dvdsub_lang);
   if (vobsub_index_id >= 0) {
     // if user asks for a vobsub id, use that first.
     mpctx->global_sub_pos = mpctx->global_sub_indices[SUB_SOURCE_VOBSUB] + vobsub_index_id;



More information about the MPlayer-cvslog mailing list