summaryrefslogtreecommitdiffstats
path: root/demux/demux_mng.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-11 19:17:51 +0200
committerwm4 <wm4@nowhere>2013-07-11 19:17:51 +0200
commit6ede485e4b2ea1093e84d8589a1c321fe8a8462a (patch)
tree83ae0b1b63c682b47bcba5a8c6607467adbd79b0 /demux/demux_mng.c
parentfa74be880c27b350615f62dd4a0d6a32be56c60e (diff)
downloadmpv-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_mng.c')
-rw-r--r--demux/demux_mng.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/demux/demux_mng.c b/demux/demux_mng.c
index 6dc0e352e8..22299ea17b 100644
--- a/demux/demux_mng.c
+++ b/demux/demux_mng.c
@@ -272,11 +272,9 @@ static int demux_mng_check_file(demuxer_t *demuxer)
/**
* \brief MPlayer callback: Fill buffer from MNG stream.
* \param[in] demuxer demuxer structure
- * \param[in] ds demuxer stream
* \return \p 1 on success, \p 0 on error
*/
-static int demux_mng_fill_buffer(demuxer_t * demuxer,
- demux_stream_t * ds)
+static int demux_mng_fill_buffer(demuxer_t * demuxer)
{
mng_priv_t * mng_priv = demuxer->priv;
mng_handle h_mng = mng_priv->h_mng;
@@ -340,7 +338,7 @@ static int demux_mng_fill_buffer(demuxer_t * demuxer,
// frame time mechanism (GIF, MATROSKA, MNG) in video.c to work.
dp->pts = (float)mng_priv->show_next_time_ms / 1000.0f;
dp->pos = stream_tell(demuxer->stream);
- ds_add_packet(demuxer->video, dp);
+ demuxer_add_packet(demuxer, demuxer->streams[0], dp);
return 1;
}
@@ -417,12 +415,6 @@ static demuxer_t * demux_mng_open(demuxer_t * demuxer)
struct sh_stream *sh = new_sh_stream(demuxer, STREAM_VIDEO);
sh_video = sh->video;
- // 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.
- // (Thanks to demux_gif.c for this.)
- sh_video->ds = demuxer->video;
-
// set format of pixels in video packets
sh_video->gsh->codec = "rawvideo";
sh_video->format = MP_FOURCC_RGB32;