summaryrefslogtreecommitdiffstats
path: root/sub/sd_ass.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-15 18:12:12 +0100
committerwm4 <wm4@nowhere>2020-02-15 18:30:42 +0100
commite54ebaec5229f9f82bc6b77cef5c5b75b7577487 (patch)
treebbc3f98c5de5873012c2c338bd4dadfd790b3301 /sub/sd_ass.c
parentc92c08edc671e64c31d98584e709b0f712864772 (diff)
downloadmpv-e54ebaec5229f9f82bc6b77cef5c5b75b7577487.tar.bz2
mpv-e54ebaec5229f9f82bc6b77cef5c5b75b7577487.tar.xz
f_decoder_wrapper, sd_add: accept "null" codec
This is for easier use with the "delay_open" feature added in the previous commit. The "null" codec is reported if the codec is unknown (because the stream was not opened yet at time the tracks were added). The rest of the timeline mechanism will set the correct codec at runtime. But this means every time a delay-loaded track is selected, it wants to initialize a decoder for the "null" codec. Accept a "null" decoder. But since FFmpeg has no such codec, and out of my own laziness, just let it fall back to "common" codecs that need no other initialization data.
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r--sub/sd_ass.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index eb80230f44..5443a688d4 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -155,7 +155,11 @@ static int init(struct sd *sd)
char *extradata = sd->codec->extradata;
int extradata_size = sd->codec->extradata_size;
- if (strcmp(sd->codec->codec, "ass") != 0) {
+ // Note: accept "null" as alias for "ass", so EDL delay_open subtitle
+ // streams work.
+ if (strcmp(sd->codec->codec, "ass") != 0 &&
+ strcmp(sd->codec->codec, "null") != 0)
+ {
ctx->is_converted = true;
ctx->converter = lavc_conv_create(sd->log, sd->codec->codec, extradata,
extradata_size);