Skip to content

Commit a10a80d

Browse files
committed
player/command: don't refresh sub stream on UPDATE_SUB option updates
Back when reselect_demux_stream call was added in this path in 700f72f, sub_redecode_cached_packets only retained the last two packets. The subtitle decoder cache was changed in 0a4b098 to retain the whole packet sequence. Therefore sub_redecode_cached_packets by itself can rebuild the new decoder state entirely from packets held in memory, and we no longer need the demuxer to refresh the track. This fixes expensive track refresh for network streams, where changing some sub-* options during runtime of network streams would cause the cache to be dropped
1 parent 94335ab commit a10a80d

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

player/command.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8247,9 +8247,6 @@ void mp_option_run_callback(struct MPContext *mpctx, struct mp_option_callback *
82478247
int ret = sub_control(sub, SD_CTRL_UPDATE_OPTS, &flags);
82488248
if (ret == CONTROL_OK && flags & (UPDATE_SUB_FILT | UPDATE_SUB_HARD)) {
82498249
sub_redecode_cached_packets(sub);
8250-
sub_reset(sub);
8251-
if (track->selected)
8252-
reselect_demux_stream(mpctx, track, true);
82538250
}
82548251
}
82558252
}

0 commit comments

Comments
 (0)