diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index bb40596dd5..ffcbd93e44 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -187,27 +187,11 @@ void free_demuxer_stream(demux_stream_t *ds) demux_stream_t *new_demuxer_stream(struct demuxer_st *demuxer, int id) { demux_stream_t *ds = malloc(sizeof(demux_stream_t)); - ds->buffer_pos = ds->buffer_size = 0; - ds->buffer = NULL; - ds->pts = 0; - ds->pts_bytes = 0; - ds->eof = 0; - ds->pos = 0; - ds->dpos = 0; - ds->pack_no = 0; - - ds->packs = 0; - ds->bytes = 0; - ds->first = ds->last = ds->current = NULL; - ds->id = id; - ds->demuxer = demuxer; - - ds->asf_seq = -1; - ds->asf_packet = NULL; - - ds->ss_mul = ds->ss_div = 0; - - ds->sh = NULL; + *ds = (demux_stream_t){ + .id = id, + .demuxer = demuxer, + .asf_seq = -1, + }; return ds; }