From 671df54e4dcf0675c335483d26f7f6ff9baaf76a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 12 Jan 2016 23:48:19 +0100 Subject: 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. --- sub/dec_sub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sub/dec_sub.c') 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 : ""); + sh->codec->codec); talloc_free(log); return NULL; } -- cgit v1.2.3