diff --git a/demux/demux_mf.c b/demux/demux_mf.c index c1cc5d79f3..3f79c547f1 100644 --- a/demux/demux_mf.c +++ b/demux/demux_mf.c @@ -39,7 +39,7 @@ typedef struct mf { struct mp_log *log; - struct sh_video *sh; + struct sh_stream *sh; int curr_frame; int nr_of_files; char **names; @@ -165,7 +165,7 @@ static void demux_seek_mf(demuxer_t *demuxer, double rel_seek_secs, int flags) if (flags & SEEK_FACTOR) newpos += rel_seek_secs * (mf->nr_of_files - 1); else - newpos += rel_seek_secs * mf->sh->fps; + newpos += rel_seek_secs * mf->sh->video->fps; if (newpos < 0) newpos = 0; if (newpos >= mf->nr_of_files) @@ -199,7 +199,7 @@ static int demux_mf_fill_buffer(demuxer_t *demuxer) demux_packet_t *dp = new_demux_packet(data.len); if (dp) { memcpy(dp->buffer, data.start, data.len); - dp->pts = mf->curr_frame / mf->sh->fps; + dp->pts = mf->curr_frame / mf->sh->video->fps; dp->keyframe = true; demux_add_packet(mf->sh, dp); } @@ -324,7 +324,9 @@ static int demux_open_mf(demuxer_t *demuxer, enum demux_check check) sh_video->disp_h = 0; sh_video->fps = demuxer->opts->mf_fps; - mf->sh = sh_video; + demux_add_sh_stream(demuxer, sh); + + mf->sh = sh; demuxer->priv = (void *)mf; demuxer->seekable = true; @@ -344,7 +346,7 @@ static int demux_control_mf(demuxer_t *demuxer, int cmd, void *arg) switch (cmd) { case DEMUXER_CTRL_GET_TIME_LENGTH: - *((double *)arg) = (double)mf->nr_of_files / mf->sh->fps; + *((double *)arg) = (double)mf->nr_of_files / mf->sh->video->fps; return DEMUXER_CTRL_OK; default: