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. --- player/sub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'player/sub.c') diff --git a/player/sub.c b/player/sub.c index 5f2f13e88f..0492be4bc8 100644 --- a/player/sub.c +++ b/player/sub.c @@ -118,9 +118,9 @@ static bool init_subdec(struct MPContext *mpctx, struct track *track) if (!track->dec_sub) return false; - struct sh_video *sh_video = - mpctx->d_video ? mpctx->d_video->header->video : NULL; - double fps = sh_video ? sh_video->fps : 25; + struct mp_codec_params *v_c = + mpctx->d_video ? mpctx->d_video->header->codec : NULL; + double fps = v_c ? v_c->fps : 25; sub_control(track->dec_sub, SD_CTRL_SET_VIDEO_DEF_FPS, &fps); // Don't do this if the file has video/audio streams. Don't do it even -- cgit v1.2.3