diff options
author | wm4 <wm4@nowhere> | 2020-08-12 19:29:10 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-08-12 19:29:10 +0200 |
commit | f0b4ad5808bbc056d031afad5bcf4d68a6a0b54b (patch) | |
tree | a3a3029ca35ea2a2803eb1928ea602aa52f0a180 /sub | |
parent | 2f0bd53c8ceaf571c6c92d03b1685f7680c78c3b (diff) | |
download | mpv-f0b4ad5808bbc056d031afad5bcf4d68a6a0b54b.tar.bz2 mpv-f0b4ad5808bbc056d031afad5bcf4d68a6a0b54b.tar.xz |
sd_ass: fix converted subtitles path
Commit cda8f1613ff3 broke this.
Diffstat (limited to 'sub')
-rw-r--r-- | sub/sd_ass.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 64d8735a7d..b01e2bdc98 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -220,6 +220,10 @@ static void assobjects_init(struct sd *sd) char *extradata = sd->codec->extradata; int extradata_size = sd->codec->extradata_size; + if (ctx->converter) { + extradata = lavc_conv_get_extradata(ctx->converter); + extradata_size = extradata ? strlen(extradata) : 0; + } if (extradata) ass_process_codec_private(ctx->ass_track, extradata, extradata_size); @@ -252,16 +256,12 @@ static int init(struct sd *sd) if (strcmp(sd->codec->codec, "ass") != 0 && strcmp(sd->codec->codec, "null") != 0) { - char *extradata = sd->codec->extradata; - int extradata_size = sd->codec->extradata_size; - ctx->is_converted = true; - ctx->converter = lavc_conv_create(sd->log, sd->codec->codec, extradata, - extradata_size); + ctx->converter = lavc_conv_create(sd->log, sd->codec->codec, + sd->codec->extradata, + sd->codec->extradata_size); if (!ctx->converter) return -1; - extradata = lavc_conv_get_extradata(ctx->converter); - extradata_size = extradata ? strlen(extradata) : 0; if (strcmp(sd->codec->codec, "eia_608") == 0) ctx->duration_unknown = 1; |