|
|
|
@ -406,6 +406,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, |
|
|
|
|
s->data_offset = FFMIN(s->data_offset, cur_os->sync_pos); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
os->nb_header++; |
|
|
|
|
os->pstart += os->psize; |
|
|
|
|
os->psize = 0; |
|
|
|
|
} |
|
|
|
@ -445,7 +446,7 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, |
|
|
|
|
static int ogg_get_headers(AVFormatContext *s) |
|
|
|
|
{ |
|
|
|
|
struct ogg *ogg = s->priv_data; |
|
|
|
|
int ret; |
|
|
|
|
int ret, i; |
|
|
|
|
|
|
|
|
|
do{ |
|
|
|
|
ret = ogg_packet(s, NULL, NULL, NULL, NULL); |
|
|
|
@ -453,6 +454,16 @@ static int ogg_get_headers(AVFormatContext *s) |
|
|
|
|
return ret; |
|
|
|
|
}while (!ogg->headers); |
|
|
|
|
|
|
|
|
|
for (i = 0; i < ogg->nstreams; i++) { |
|
|
|
|
struct ogg_stream *os = ogg->streams + i; |
|
|
|
|
|
|
|
|
|
if (os->codec && os->codec->nb_header && |
|
|
|
|
os->nb_header < os->codec->nb_header) { |
|
|
|
|
av_log(s, AV_LOG_ERROR, |
|
|
|
|
"Headers mismatch for stream %d\n", i); |
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
av_dlog(s, "found headers\n"); |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|