summaryrefslogtreecommitdiffstats
path: root/demux/demux_mf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-23 21:58:01 +0100
committerwm4 <wm4@nowhere>2015-12-23 21:58:01 +0100
commit25497226cf9c11249230579f5f768ca9b186c090 (patch)
tree9cdc8197fc719e88f6da6848f8004fb608dc87bd /demux/demux_mf.c
parentf9ba1a3ddf5186cb31c2715e3293eef70575a9ee (diff)
downloadmpv-25497226cf9c11249230579f5f768ca9b186c090.tar.bz2
mpv-25497226cf9c11249230579f5f768ca9b186c090.tar.xz
demux_mf: fix previous commit
It was total crap.
Diffstat (limited to 'demux/demux_mf.c')
-rw-r--r--demux/demux_mf.c12
1 files changed, 7 insertions, 5 deletions
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: