[MPlayer-cvslog] r38066 - trunk/mplayer.c

ib subversion at mplayerhq.hu
Thu Apr 12 14:29:17 EEST 2018


Author: ib
Date: Thu Apr 12 14:29:17 2018
New Revision: 38066

Log:
Adjust the count of SUB_SOURCE_SUBS when updating set_of_subtitles.

When deleting or adding a subtitle, update not only set_of_sub_size,
but sub_counts[SUB_SOURCE_SUBS] as well. The count will be otherwise
useless.

Modified:
   trunk/mplayer.c

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Thu Apr 12 12:34:27 2018	(r38065)
+++ trunk/mplayer.c	Thu Apr 12 14:29:17 2018	(r38066)
@@ -1135,6 +1135,7 @@ void update_set_of_subtitles(void)
             set_of_subtitles[i - 1] = set_of_subtitles[i];
         set_of_subtitles[mpctx->set_of_sub_size - 1] = NULL;
         --mpctx->set_of_sub_size;
+        --mpctx->sub_counts[SUB_SOURCE_SUBS];
         if (mpctx->set_of_sub_size > 0)
             subdata = set_of_subtitles[mpctx->set_of_sub_pos = 0];
     } else if (mpctx->set_of_sub_size > 0 && subdata != NULL) { // *subdata was changed
@@ -1142,6 +1143,7 @@ void update_set_of_subtitles(void)
     } else if (mpctx->set_of_sub_size <= 0 && subdata != NULL) { // *subdata was added
         set_of_subtitles[mpctx->set_of_sub_pos = mpctx->set_of_sub_size] = subdata;
         ++mpctx->set_of_sub_size;
+        ++mpctx->sub_counts[SUB_SOURCE_SUBS];
     }
 }
 


More information about the MPlayer-cvslog mailing list