[FFmpeg-cvslog] brstm: do not return partial packets

Paul B Mahol git at videolan.org
Fri Dec 7 19:01:13 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Dec  7 17:52:23 2012 +0000| [fe63d4130235390603df3e91e8a7ac9b3bf05308] | committer: Paul B Mahol

brstm: do not return partial packets

Such packets are useless.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fe63d4130235390603df3e91e8a7ac9b3bf05308
---

 libavformat/brstm.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavformat/brstm.c b/libavformat/brstm.c
index a4db35a..0a874d3 100644
--- a/libavformat/brstm.c
+++ b/libavformat/brstm.c
@@ -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;
 }
 



More information about the ffmpeg-cvslog mailing list