summaryrefslogtreecommitdiffstats
path: root/sub/dec_sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-12 23:48:19 +0100
committerwm4 <wm4@nowhere>2016-01-12 23:48:19 +0100
commit671df54e4dcf0675c335483d26f7f6ff9baaf76a (patch)
tree6a206ddf489474150fffa2eac651b5e8915b969c /sub/dec_sub.c
parent81f3b3aafe72e5ca9ac79d29246e70dce76ebca9 (diff)
downloadmpv-671df54e4dcf0675c335483d26f7f6ff9baaf76a.tar.bz2
mpv-671df54e4dcf0675c335483d26f7f6ff9baaf76a.tar.xz
demux: merge sh_video/sh_audio/sh_sub
This is mainly a refactor. I'm hoping it will make some things easier in the future due to cleanly separating codec metadata and stream metadata. Also, declare that the "codec" field can not be NULL anymore. demux.c will set it to "" if it's NULL when added. This gets rid of a corner case everything had to handle, but which rarely happened.
Diffstat (limited to 'sub/dec_sub.c')
-rw-r--r--sub/dec_sub.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index c0c98c42cc..561f8b8be8 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -81,7 +81,7 @@ void sub_destroy(struct dec_sub *sub)
struct dec_sub *sub_create(struct mpv_global *global, struct demuxer *demuxer,
struct sh_stream *sh)
{
- assert(demuxer && sh && sh->sub);
+ assert(demuxer && sh && sh->type == STREAM_SUB);
struct mp_log *log = mp_log_new(NULL, global->log, "sub");
@@ -101,7 +101,7 @@ struct dec_sub *sub_create(struct mpv_global *global, struct demuxer *demuxer,
.opts = sub->opts,
.driver = driver,
.demuxer = demuxer,
- .sh = sh,
+ .codec = sh->codec,
};
if (sh->codec && sub->sd->driver->init(sub->sd) >= 0)
@@ -113,7 +113,7 @@ struct dec_sub *sub_create(struct mpv_global *global, struct demuxer *demuxer,
}
mp_err(log, "Could not find subtitle decoder for format '%s'.\n",
- sh->codec ? sh->codec : "<unknown>");
+ sh->codec->codec);
talloc_free(log);
return NULL;
}