]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/amr.c
Take the target address family in account when determining the family of
[ffmpeg] / libavformat / amr.c
index 92223ed72007237364e0236884c971bddb87c6a5..c0a8707b6aabe41dd0f37fb197086e22359fd3e5 100644 (file)
@@ -87,7 +87,7 @@ static int amr_read_header(AVFormatContext *s,
     st = av_new_stream(s, 0);
     if (!st)
     {
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     }
     if(memcmp(header,AMR_header,6)!=0)
     {
@@ -118,11 +118,11 @@ static int amr_read_packet(AVFormatContext *s,
                           AVPacket *pkt)
 {
     AVCodecContext *enc = s->streams[0]->codec;
-    int read, size, toc, mode;
+    int read, size = 0, toc, mode;
 
     if (url_feof(&s->pb))
     {
-        return AVERROR_IO;
+        return AVERROR(EIO);
     }
 
 //FIXME this is wrong, this should rather be in a AVParset
@@ -148,7 +148,7 @@ static int amr_read_packet(AVFormatContext *s,
 
     if ( (size==0) || av_new_packet(pkt, size))
     {
-        return AVERROR_IO;
+        return AVERROR(EIO);
     }
 
     pkt->stream_index = 0;
@@ -160,7 +160,7 @@ static int amr_read_packet(AVFormatContext *s,
     if (read != size-1)
     {
         av_free_packet(pkt);
-        return AVERROR_IO;
+        return AVERROR(EIO);
     }
 
     return 0;