]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mpc.c
Split some really long lines
[ffmpeg] / libavformat / mpc.c
index 8b2358ea484b3ee5b87eca7d9476439e2270b5b0..ac6733788f934badecc5f0be0875aac17c1946c0 100644 (file)
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "avformat.h"
 #include "bitstream.h"
@@ -42,8 +42,6 @@ typedef struct {
 static int mpc_probe(AVProbeData *p)
 {
     const uint8_t *d = p->buf;
-    if (p->buf_size < 32)
-        return 0;
     if (d[0] == 'M' && d[1] == 'P' && d[2] == '+' && (d[3] == 0x17 || d[3] == 0x7))
         return AVPROBE_SCORE_MAX;
     if (d[0] == 'I' && d[1] == 'D' && d[2] == '3')
@@ -94,7 +92,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
     st = av_new_stream(s, 0);
     if (!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     st->codec->codec_type = CODEC_TYPE_AUDIO;
     st->codec->codec_id = CODEC_ID_MUSEPACK7;
     st->codec->channels = 2;
@@ -118,7 +116,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
     int ret, size, size2, curbits, cur = c->curframe;
     int64_t tmp, pos;
 
-    if (c->curframe > c->fcount)
+    if (c->curframe >= c->fcount)
         return -1;
 
     if(c->curframe != c->lastframe + 1){
@@ -150,7 +148,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
     c->curbits = (curbits + size2) & 0x1F;
 
     if (av_new_packet(pkt, size) < 0)
-        return AVERROR_IO;
+        return AVERROR(EIO);
 
     pkt->data[0] = curbits;
     pkt->data[1] = (c->curframe > c->fcount);
@@ -162,7 +160,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
         url_fseek(&s->pb, -4, SEEK_CUR);
     if(ret < size){
         av_free_packet(pkt);
-        return AVERROR_IO;
+        return AVERROR(EIO);
     }
     pkt->size = ret + 4;