};
static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts);
+static int ogg_read_close(AVFormatContext *s);
//FIXME We could avoid some structure duplication
static int ogg_save(AVFormatContext *s)
struct ogg_stream *os;
unsigned bufsize;
uint8_t *buf;
+ struct ogg_codec *codec;
if (ogg->nstreams != 1) {
av_log_missing_feature(s, "Changing stream parameters in multistream ogg", 0);
buf = os->buf;
bufsize = os->bufsize;
+ codec = os->codec;
if (!ogg->state || ogg->state->streams[0].private != os->private)
av_freep(&ogg->streams[0].private);
os->bufsize = bufsize;
os->buf = buf;
os->header = -1;
+ os->codec = codec;
return 0;
}
//linear headers seek from start
do {
ret = ogg_packet(s, NULL, NULL, NULL, NULL);
- if (ret < 0)
+ if (ret < 0) {
+ ogg_read_close(s);
return ret;
+ }
} while (!ogg->headers);
av_dlog(s, "found headers\n");