# HG changeset patch # User mru # Date 1168898722 0 # Node ID a472266b5d39684e9518ec20e5cb16a8db0df119 # Parent 184229324f14b8150218b9ddea264e0d31eafe5a save/restore number of streams diff -r 184229324f14 -r a472266b5d39 ogg2.c --- a/ogg2.c Mon Jan 15 07:41:28 2007 +0000 +++ b/ogg2.c Mon Jan 15 22:05:22 2007 +0000 @@ -90,6 +90,7 @@ ost->pos = url_ftell (&s->pb);; ost->curidx = ogg->curidx; ost->next = ogg->state; + ost->nstreams = ogg->nstreams; memcpy(ost->streams, ogg->streams, ogg->nstreams * sizeof(*ogg->streams)); for (i = 0; i < ogg->nstreams; i++){ @@ -123,8 +124,9 @@ url_fseek (bc, ost->pos, SEEK_SET); ogg->curidx = ost->curidx; - memcpy (ogg->streams, ost->streams, - ogg->nstreams * sizeof (*ogg->streams)); + ogg->nstreams = ost->nstreams; + memcpy(ogg->streams, ost->streams, + ost->nstreams * sizeof(*ogg->streams)); } av_free (ost); diff -r 184229324f14 -r a472266b5d39 ogg2.h --- a/ogg2.h Mon Jan 15 07:41:28 2007 +0000 +++ b/ogg2.h Mon Jan 15 22:05:22 2007 +0000 @@ -57,6 +57,7 @@ uint64_t pos; int curidx; struct ogg_state *next; + int nstreams; ogg_stream_t streams[1]; } ogg_state_t;