diff options
author | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-05-12 20:40:39 +0000 |
---|---|---|
committer | eugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-05-12 20:40:39 +0000 |
commit | 27cdeb019dfe41fd7c349fcec2dc5fb79aa88001 (patch) | |
tree | ee44b6df5c33b1e8fe75c914c3ba7042c53b80c8 | |
parent | 233ac8d3192f3fc3f7e76d5393cc6f479adb7da9 (diff) |
Change subtitle selection order by giving "indirect" ways of specifying the
desired subtitle track the least priority.
Selection of displayed subtitles by language (-slang) and default track
attribute is only performed if all other ways have failed. They are not
directly controllable by the user (especially default tracks), therefore they
should not override -sub, -vobsub and even auto-subs.
Based on a patch by Sergey Malkovsky (mplayer.win32_gmail_com).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26752 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | mplayer.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -3464,10 +3464,7 @@ 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 (dvdsub_id < 0) - dvdsub_id = demuxer_default_sub_track(mpctx->demuxer); + mpctx->global_sub_pos = -1; // no subs by default 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; @@ -3477,14 +3474,19 @@ 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) { + // finally select subs by language and container hints + if (dvdsub_id < 0 && dvdsub_lang) + dvdsub_id = demuxer_sub_track_by_lang(mpctx->demuxer, dvdsub_lang); + if (dvdsub_id < 0) + 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; /* } else if (mpctx->global_sub_indices[SUB_SOURCE_DEMUX] >= 0) { // if nothing else works, get subs from the demuxer. mpctx->global_sub_pos = mpctx->global_sub_indices[SUB_SOURCE_DEMUX]; */ - } else { - // nothing worth doing automatically. - mpctx->global_sub_pos = -1; } // rather than duplicate code, use the SUB_SELECT handler to init the right one. mpctx->global_sub_pos--; |