OSDN Git Service

ogg_read_packet: forward error code.
authorNicolas George <nicolas.george@normalesup.org>
Fri, 24 Jun 2011 10:02:41 +0000 (12:02 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sat, 25 Jun 2011 09:03:23 +0000 (11:03 +0200)
libavformat/oggdec.c

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