mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-29 15:11:09 +08:00
sub: reset sub decoder correctly when cycling subtitles
reset_subtitles() works in mpctx->d_sub[], which is set to NULL before calling it from uninit_sub(). This fixes resetting the subtitle when cycling subtitle tracks. Actually, this was probably a feature, because it's annoying if subtitles don't show up when cycling them. But it also can have unintended consequences, so get rid of it.
This commit is contained in:
committed by
Diogo Franco (Kovensky)
parent
99cca56a99
commit
2cac69f221
+1
-3
@@ -146,10 +146,8 @@ void uninit_stream_sub_decoders(struct demuxer *demuxer)
|
||||
void uninit_sub(struct MPContext *mpctx, int order)
|
||||
{
|
||||
if (mpctx->d_sub[order]) {
|
||||
mpctx->d_sub[order] = NULL; // Note: not free'd.
|
||||
int obj = order ? OSDTYPE_SUB2 : OSDTYPE_SUB;
|
||||
osd_set_sub(mpctx->osd, obj, NULL);
|
||||
reset_subtitles(mpctx, order);
|
||||
mpctx->d_sub[order] = NULL; // Note: not free'd.
|
||||
reselect_demux_streams(mpctx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user