demuxer.c: Add initialization missing from previous commit

Reimar's previous commit ("Unbreak the demuxer-specific code in
video.c with e.g.") added the new field "non_interleaved" in
demux_stream structs, but this field was not initialized anywhere.
Under suitable circumstances this could cause a "Too many
video/audio packets in the buffer" error and failing playback. Fix
the problem by cleaning up the code that creates new instances of the
struct. Now fields will be initialized to 0 by default.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29812 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
uau 2009-11-02 01:40:09 +00:00
parent b0d6753723
commit ce2300b437
1 changed files with 5 additions and 21 deletions

View File

@ -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 *new_demuxer_stream(struct demuxer_st *demuxer, int id)
{ {
demux_stream_t *ds = malloc(sizeof(demux_stream_t)); demux_stream_t *ds = malloc(sizeof(demux_stream_t));
ds->buffer_pos = ds->buffer_size = 0; *ds = (demux_stream_t){
ds->buffer = NULL; .id = id,
ds->pts = 0; .demuxer = demuxer,
ds->pts_bytes = 0; .asf_seq = -1,
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;
return ds; return ds;
} }