changeset 1657:a472266b5d39 libavformat

save/restore number of streams
author mru
date Mon, 15 Jan 2007 22:05:22 +0000
parents 184229324f14
children 2400a22af998
files ogg2.c ogg2.h
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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;