summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-06-24 08:10:07 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-06-24 08:10:07 +0000
commit547ae18be29e568057376a45745d5f440df56a5c (patch)
tree3bb52241fef059a7c090e2f70d1d0eba8506845b /command.c
parent27bf5698d12816547c266fe787160e9c8cb03eae (diff)
downloadmpv-547ae18be29e568057376a45745d5f440df56a5c.tar.bz2
mpv-547ae18be29e568057376a45745d5f440df56a5c.tar.xz
Simplify and correct subtitle selection, no more special cases for
DVD and Matroska and -sid should now always match the ID_* message. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23619 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r--command.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/command.c b/command.c
index 53067c3dc8..b2bd9f89b2 100644
--- a/command.c
+++ b/command.c
@@ -1293,25 +1293,19 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg,
} else if (source == SUB_SOURCE_DEMUX) {
dvdsub_id =
mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_DEMUX];
- if (d_sub) {
- if (mpctx->stream->type != STREAMTYPE_DVD
- && mpctx->stream->type != STREAMTYPE_DVDNAV) {
- int i = 0;
- d_sub->sh = NULL;
- for (d_sub->id = 0; d_sub->id < MAX_S_STREAMS; d_sub->id++) {
- if (mpctx->demuxer->s_streams[d_sub->id]) {
- if (i == dvdsub_id) {
- d_sub->sh = mpctx->demuxer->s_streams[d_sub->id];
- break;
- }
- i++;
- }
+ if (d_sub && dvdsub_id < MAX_S_STREAMS) {
+ int i = 0;
+ // default: assume 1:1 mapping of sid and stream id
+ d_sub->id = dvdsub_id;
+ d_sub->sh = mpctx->demuxer->s_streams[d_sub->id];
+ for (i = 0; i < MAX_S_STREAMS; i++) {
+ sh_sub_t *sh = mpctx->demuxer->s_streams[i];
+ if (sh && sh->sid == dvdsub_id) {
+ d_sub->id = i;
+ d_sub->sh = sh;
+ break;
}
}
- else if (vo_spudec)
- d_sub->id = dvdsub_id;
- if (mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA)
- d_sub->id = demux_mkv_change_subs(mpctx->demuxer, dvdsub_id);
if (d_sub->sh && d_sub->id >= 0) {
sh_sub_t *sh = d_sub->sh;
if (sh->type == 'v')