]> git.sesse.net Git - ffmpeg/commitdiff
brstm: do not return partial packets
authorPaul B Mahol <onemda@gmail.com>
Fri, 7 Dec 2012 17:52:23 +0000 (17:52 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 7 Dec 2012 17:55:45 +0000 (17:55 +0000)
Such packets are useless.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavformat/brstm.c

index a4db35a9be7c9c2bdc4401aae3442f22779fe8d4..0a874d374cdd0fa4a8f235951d57f8e61e283448 100644 (file)
@@ -266,19 +266,18 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
                                     (b->current_block - 1), 4 * codec->channels);
 
         ret = avio_read(s->pb, dst, size);
-        if (ret < 0) {
+        if (ret != size)
             av_free_packet(pkt);
-            return ret;
-        }
         pkt->duration = samples;
     } else {
         ret = av_get_packet(s->pb, pkt, size);
-        if (ret < 0)
-            return ret;
     }
 
     pkt->stream_index = 0;
 
+    if (ret != size)
+        ret = AVERROR(EIO);
+
     return ret;
 }