diff options
author | wm4 <wm4@nowhere> | 2019-05-24 19:19:45 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:04 +0200 |
commit | 001db94d1e7337d94c9bb573343365c803ed126a (patch) | |
tree | 04aaf4430f5fa9cdd2fae99e4236f9e59939db17 /demux/demux.c | |
parent | 085c7106b9a1ee996cec89d747702dbe7eb29fb7 (diff) | |
download | mpv-001db94d1e7337d94c9bb573343365c803ed126a.tar.bz2 mpv-001db94d1e7337d94c9bb573343365c803ed126a.tar.xz |
demux: remove some redundant pointer indirections
In all of these cases ds->in should be the same as the local variable
in, and neither ds->in nor in ever change, i.e. a cosmetic
simplification.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/demux/demux.c b/demux/demux.c index c9792a3024..27866fba83 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1818,7 +1818,7 @@ static void add_packet_locked(struct sh_stream *stream, demux_packet_t *dp) } size_t bytes = demux_packet_estimate_total_size(dp); - ds->in->total_bytes += bytes; + in->total_bytes += bytes; if (ds->reader_head) { ds->fw_packs++; ds->fw_bytes += bytes; @@ -2300,7 +2300,7 @@ static int dequeue_packet(struct demux_stream *ds, struct demux_packet **res) abort(); pkt->next = NULL; - if (ds->in->back_demuxing) { + if (in->back_demuxing) { if (ds->back_range_min && pkt->keyframe) ds->back_range_min -= 1; if (ds->back_range_min) { @@ -2339,16 +2339,16 @@ static int dequeue_packet(struct demux_stream *ds, struct demux_packet **res) ds->last_br_bytes += pkt->len; // This implies this function is actually called from "the" user thread. - if (pkt->pos >= ds->in->d_user->filepos) - ds->in->d_user->filepos = pkt->pos; - ds->in->d_user->filesize = ds->in->stream_size; + if (pkt->pos >= in->d_user->filepos) + in->d_user->filepos = pkt->pos; + in->d_user->filesize = in->stream_size; - pkt->pts = MP_ADD_PTS(pkt->pts, ds->in->ts_offset); - pkt->dts = MP_ADD_PTS(pkt->dts, ds->in->ts_offset); + pkt->pts = MP_ADD_PTS(pkt->pts, in->ts_offset); + pkt->dts = MP_ADD_PTS(pkt->dts, in->ts_offset); if (pkt->segmented) { - pkt->start = MP_ADD_PTS(pkt->start, ds->in->ts_offset); - pkt->end = MP_ADD_PTS(pkt->end, ds->in->ts_offset); + pkt->start = MP_ADD_PTS(pkt->start, in->ts_offset); + pkt->end = MP_ADD_PTS(pkt->end, in->ts_offset); } // Apply timed metadata when packet is returned to user. @@ -2358,12 +2358,12 @@ static int dequeue_packet(struct demux_stream *ds, struct demux_packet **res) metadata = ds->tags_init; if (metadata != ds->tags_reader) { mp_packet_tags_setref(&ds->tags_reader, metadata); - ds->in->events |= DEMUX_EVENT_METADATA; - if (ds->in->wakeup_cb) - ds->in->wakeup_cb(ds->in->wakeup_cb_ctx); + in->events |= DEMUX_EVENT_METADATA; + if (in->wakeup_cb) + in->wakeup_cb(in->wakeup_cb_ctx); } - prune_old_packets(ds->in); + prune_old_packets(in); *res = pkt; return 1; } |