diff options
author | wm4 <wm4@nowhere> | 2019-06-13 20:49:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:05 +0200 |
commit | 021ccb96440e63a317d7a9737606a3eb720205d9 (patch) | |
tree | ea98b156e601467175459a31b890d6824db7f238 /demux/demux.c | |
parent | e320f02187a19e62b5bb48d4fd7cf5625dbee83c (diff) | |
download | mpv-021ccb96440e63a317d7a9737606a3eb720205d9.tar.bz2 mpv-021ccb96440e63a317d7a9737606a3eb720205d9.tar.xz |
demux: turn some redundant assignments into asserts
demux_packet.next should not be used outside of demux.c, and in this
case it's a packet that was just passed to demux.c from the outside.
demux_packet.stream is already set by the demuxer, and this is assured
by the add_packet_locked() caller.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/demux/demux.c b/demux/demux.c index 11b89a7b37..e09a4e843c 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1245,6 +1245,7 @@ void demuxer_feed_caption(struct sh_stream *stream, demux_packet_t *dp) dp->keyframe = true; dp->pts = MP_ADD_PTS(dp->pts, -in->ts_offset); dp->dts = MP_ADD_PTS(dp->dts, -in->ts_offset); + dp->stream = sh->index; add_packet_locked(sh, dp); pthread_mutex_unlock(&in->lock); } @@ -1892,6 +1893,10 @@ static void add_packet_locked(struct sh_stream *stream, demux_packet_t *dp) talloc_free(dp); return; } + + assert(dp->stream == stream->index); + assert(!dp->next); + struct demux_internal *in = ds->in; in->after_seek = false; @@ -1945,9 +1950,6 @@ static void add_packet_locked(struct sh_stream *stream, demux_packet_t *dp) ds->global_correct_pos &= queue->correct_pos; ds->global_correct_dts &= queue->correct_dts; - dp->stream = stream->index; - dp->next = NULL; - // (keep in mind that even if the reader went out of data, the queue is not // necessarily empty due to the backbuffer) if (!ds->reader_head && (!ds->skip_to_keyframe || dp->keyframe)) { |