mirror of
https://github.com/mpv-player/mpv.git
synced 2026-05-07 20:02:49 +00:00
sub/lavc_conv: prevent corruption after switching WebM WebVTT subs
WebVTT subtitles in WebM require special logic, and we signal that using
the "webvtt-webm" codec name, which is not part of FFmpeg. That worked
fine until commit 94859997b8 ("sub: update codec info") added a call
to mp_codec_info_from_av(), which overwrites our codec name with
FFmpeg's the first time the subtitle decoder is initialized. As a
result, WebM WebVTT subtitles are currently not rendered correctly after
switching subtitle tracks. Fix the issue by resetting the codec name
after calling mp_codec_info_from_av().
This commit is contained in:
@@ -104,6 +104,8 @@ struct lavc_conv *lavc_conv_create(struct sd *sd)
|
||||
priv->extradata = talloc_strndup(priv, avctx->subtitle_header,
|
||||
avctx->subtitle_header_size);
|
||||
mp_codec_info_from_av(avctx, sd->codec);
|
||||
// Keep original codec name, which get_lavc_format() may have transformed
|
||||
sd->codec->codec = priv->codec;
|
||||
return priv;
|
||||
|
||||
error:
|
||||
|
||||
Reference in New Issue
Block a user