[MPlayer-cvslog] r29730 - in trunk: cfg-common-opts.h mencoder.c mplayer.c

reimar subversion at mplayerhq.hu
Mon Sep 28 13:32:27 CEST 2009


Author: reimar
Date: Mon Sep 28 13:32:27 2009
New Revision: 29730

Log:
Add a -nosub option that allows disabling auto-selected subtitles as e.g. the
mkv demuxer supports.

Modified:
   trunk/cfg-common-opts.h
   trunk/mencoder.c
   trunk/mplayer.c

Modified: trunk/cfg-common-opts.h
==============================================================================
--- trunk/cfg-common-opts.h	Mon Sep 28 13:31:25 2009	(r29729)
+++ trunk/cfg-common-opts.h	Mon Sep 28 13:32:27 2009	(r29730)
@@ -132,6 +132,7 @@
 	{"ausid", &audio_substream_id, CONF_TYPE_INT, 0, 0, 0, NULL},
 	{"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL},
 	{"sid", &dvdsub_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL},
+	{"nosub", &dvdsub_id, CONF_TYPE_FLAG, 0, -1, -2, NULL},
 	{"novideo", &video_id, CONF_TYPE_FLAG, 0, -1, -2, NULL},
 
 	{ "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL },

Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c	Mon Sep 28 13:31:25 2009	(r29729)
+++ trunk/mencoder.c	Mon Sep 28 13:32:27 2009	(r29730)
@@ -101,7 +101,7 @@ float stream_cache_seek_min_percent=50.0
 
 int audio_id=-1;
 int video_id=-1;
-int dvdsub_id=-2;
+int dvdsub_id=-1;
 int vobsub_id=-1;
 char* audio_lang=NULL;
 char* dvdsub_lang=NULL;
@@ -554,10 +554,10 @@ if(stream->type==STREAMTYPE_DVDNAV){
 
   select_audio(demuxer, audio_id, audio_lang);
 
-  if (dvdsub_id < 0 && dvdsub_lang)
+  if (dvdsub_id == -1 && dvdsub_lang)
     dvdsub_id = demuxer_sub_track_by_lang(demuxer, dvdsub_lang);
 
-  if (dvdsub_id < 0)
+  if (dvdsub_id == -1)
     dvdsub_id = demuxer_default_sub_track(demuxer);
 
   for (i = 0; i < MAX_S_STREAMS; i++) {

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Mon Sep 28 13:31:25 2009	(r29729)
+++ trunk/mplayer.c	Mon Sep 28 13:32:27 2009	(r29730)
@@ -253,7 +253,7 @@ extern char *sub_demuxer_name; // overri
 // streaming:
 int audio_id=-1;
 int video_id=-1;
-int dvdsub_id=-2;
+int dvdsub_id=-1;
 int vobsub_id=-1;
 char* audio_lang=NULL;
 char* dvdsub_lang=NULL;
@@ -3491,11 +3491,11 @@ if (mpctx->global_sub_size) {
   } else if (mpctx->global_sub_indices[SUB_SOURCE_SUBS] >= 0) {
     // if there are text subs to use, use those.  (autosubs come last here)
     mpctx->global_sub_pos = mpctx->global_sub_indices[SUB_SOURCE_SUBS];
-  } else if (dvdsub_id < 0 && mpctx->global_sub_indices[SUB_SOURCE_DEMUX] >= 0) {
+  } else if (dvdsub_id == -1 && mpctx->global_sub_indices[SUB_SOURCE_DEMUX] >= 0) {
     // finally select subs by language and container hints
-    if (dvdsub_id < 0 && dvdsub_lang)
+    if (dvdsub_id == -1 && dvdsub_lang)
       dvdsub_id = demuxer_sub_track_by_lang(mpctx->demuxer, dvdsub_lang);
-    if (dvdsub_id < 0)
+    if (dvdsub_id == -1)
       dvdsub_id = demuxer_default_sub_track(mpctx->demuxer);
     if (dvdsub_id >= 0)
       mpctx->global_sub_pos = mpctx->global_sub_indices[SUB_SOURCE_DEMUX] + dvdsub_id;


More information about the MPlayer-cvslog mailing list