Author: reimar Date: Thu Jul 29 19:05:23 2010 New Revision: 31863 Log: Update global_sub_pos if we auto-selected a subtitle. This avoid strange behaviour with subtitle selection in that case, because the subtitle selection code thinks no subtitle was displayed while we actually did display one. Modified: trunk/command.c Modified: trunk/command.c ============================================================================== --- trunk/command.c Thu Jul 29 19:03:14 2010 (r31862) +++ trunk/command.c Thu Jul 29 19:05:23 2010 (r31863) @@ -98,6 +98,8 @@ static void rescale_input_coordinates(in vo_dheight, vo_fs); } +static int sub_pos_by_source(MPContext *mpctx, int src); + static void update_global_sub_size(MPContext *mpctx) { int i; @@ -110,12 +112,16 @@ static void update_global_sub_size(MPCon if (cnt > mpctx->sub_counts[SUB_SOURCE_DEMUX]) mpctx->sub_counts[SUB_SOURCE_DEMUX] = cnt; - // TODO: possibly adjust global_sub_pos - // update global size mpctx->global_sub_size = 0; for (i = 0; i < SUB_SOURCES; i++) mpctx->global_sub_size += mpctx->sub_counts[i]; + + // update global_sub_pos if we auto-detected a demuxer sub + if (mpctx->global_sub_pos == -1 && + mpctx->demuxer->sub && mpctx->demuxer->sub->id >= 0) + mpctx->global_sub_pos = sub_pos_by_source(mpctx, SUB_SOURCE_DEMUX) + + mpctx->demuxer->sub->id; } static int sub_pos_by_source(MPContext *mpctx, int src)
participants (1)
-
reimar