diff options
author | wm4 <wm4@nowhere> | 2013-07-11 19:17:51 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-11 19:17:51 +0200 |
commit | 6ede485e4b2ea1093e84d8589a1c321fe8a8462a (patch) | |
tree | 83ae0b1b63c682b47bcba5a8c6607467adbd79b0 /demux/demux_mf.c | |
parent | fa74be880c27b350615f62dd4a0d6a32be56c60e (diff) | |
download | mpv-6ede485e4b2ea1093e84d8589a1c321fe8a8462a.tar.bz2 mpv-6ede485e4b2ea1093e84d8589a1c321fe8a8462a.tar.xz |
core: don't access demux_stream outside of demux.c, make it private
Generally remove all accesses to demux_stream from all the code, except
inside of demux.c. Make it completely private to demux.c.
This simplifies the code because it removes an extra concept. In demux.c
it is reduced to a simple packet queue. There were other uses of
demux_stream, but they were removed or are removed with this commit.
Remove the extra "ds" argument to demux fill_buffer callback. It was
used by demux_avi and the TV pseudo-demuxer only.
Remove usage of d_video->last_pts from the no-correct-pts code. This
field contains the last PTS retrieved after a packet that is not NOPTS.
We can easily get this value manually because we read the packets
ourselves. Reuse sh_video->last_pts to store the packet PTS values. It
was used only by the correct-pts code before, and like d_video->last_pts,
it is reset on seek. The behavior should be exactly the same.
Diffstat (limited to 'demux/demux_mf.c')
-rw-r--r-- | demux/demux_mf.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/demux/demux_mf.c b/demux/demux_mf.c index 8435c36f37..491a91bccf 100644 --- a/demux/demux_mf.c +++ b/demux/demux_mf.c @@ -61,7 +61,8 @@ static void demux_seek_mf(demuxer_t *demuxer,float rel_seek_secs,float audio_del // return value: // 0 = EOF or no stream found // 1 = successfully read a packet -static int demux_mf_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds){ +static int demux_mf_fill_buffer(demuxer_t *demuxer) +{ mf_t *mf = demuxer->priv; if (mf->curr_frame >= mf->nr_of_files) return 0; @@ -85,7 +86,7 @@ static int demux_mf_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds){ dp->pts = mf->curr_frame / mf->sh->fps; dp->pos = mf->curr_frame; dp->keyframe = true; - ds_add_packet(demuxer->video, dp); + demuxer_add_packet(demuxer, demuxer->streams[0], dp); } talloc_free(data.start); } @@ -215,11 +216,6 @@ static demuxer_t* demux_open_mf(demuxer_t* demuxer){ goto error; } - // make sure that the video demuxer stream header knows about its - // parent video demuxer stream (this is getting wacky), or else - // video_read_properties() will choke - sh_video->ds = demuxer->video; - sh_video->disp_w = 0; sh_video->disp_h = 0; sh_video->fps = mf_fps; |