ogg_read_packet: forward error code.

This commit is contained in:
Nicolas George 2011-06-24 12:02:41 +02:00
parent dca3542d35
commit 392aa6e444
1 changed files with 7 additions and 5 deletions

View File

@ -550,15 +550,16 @@ static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
{ {
struct ogg *ogg; struct ogg *ogg;
struct ogg_stream *os; struct ogg_stream *os;
int idx = -1; int idx = -1, ret;
int pstart, psize; int pstart, psize;
int64_t fpos, pts, dts; int64_t fpos, pts, dts;
//Get an ogg packet //Get an ogg packet
retry: retry:
do{ do{
if (ogg_packet (s, &idx, &pstart, &psize, &fpos) < 0) ret = ogg_packet (s, &idx, &pstart, &psize, &fpos);
return AVERROR(EIO); if (ret < 0)
return ret;
}while (idx < 0 || !s->streams[idx]); }while (idx < 0 || !s->streams[idx]);
ogg = s->priv_data; ogg = s->priv_data;
@ -572,8 +573,9 @@ retry:
os->keyframe_seek = 0; os->keyframe_seek = 0;
//Alloc a pkt //Alloc a pkt
if (av_new_packet (pkt, psize) < 0) ret = av_new_packet (pkt, psize);
return AVERROR(EIO); if (ret < 0)
return ret;
pkt->stream_index = idx; pkt->stream_index = idx;
memcpy (pkt->data, os->buf + pstart, psize); memcpy (pkt->data, os->buf + pstart, psize);