summaryrefslogtreecommitdiff
path: root/libavformat/mpc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-31 22:41:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-31 22:41:00 +0200
commitd1dad7c824c14939a0e18fa262f3e51957de6e3e (patch)
tree615f6ba80611f53e520d2ae479d9d4409077a78d /libavformat/mpc.c
parentd2ca5dd0f33b0fdbb5d2a7429c8f71ff1dffffb7 (diff)
parentf2ed006c90ccb65cd143d8b0fcfc28ffb98c4289 (diff)
downloadffmpeg-d1dad7c824c14939a0e18fa262f3e51957de6e3e.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: mpc8: return more meaningful error codes. mpc: return more meaningful error codes. wv,mpc8: don't return apetag data in packets. rtmp: do not warn about receiving metadata packets x86: h264dsp: Adjust YASM #ifdefs x86: yadif: Mark mmxext optimizations as such h264: convert loop filter strength dsp function to yasm. Improve descriptiveness of a number of codec and container long names Conflicts: libavcodec/flvdec.c libavcodec/libopenjpegdec.c libavformat/apetag.c libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpc.c')
-rw-r--r--libavformat/mpc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/mpc.c b/libavformat/mpc.c
index 4637fcb138..03e09e94c5 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -59,17 +59,17 @@ static int mpc_read_header(AVFormatContext *s)
if(avio_rl24(s->pb) != MKTAG('M', 'P', '+', 0)){
av_log(s, AV_LOG_ERROR, "Not a Musepack file\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
c->ver = avio_r8(s->pb);
if(c->ver != 0x07 && c->ver != 0x17){
av_log(s, AV_LOG_ERROR, "Can demux Musepack SV7, got version %02X\n", c->ver);
- return -1;
+ return AVERROR_INVALIDDATA;
}
c->fcount = avio_rl32(s->pb);
if((int64_t)c->fcount * sizeof(MPCFrame) >= UINT_MAX){
av_log(s, AV_LOG_ERROR, "Too many frames, seeking is not possible\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
if(c->fcount){
c->frames = av_malloc(c->fcount * sizeof(MPCFrame));
@@ -122,7 +122,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
if (c->curframe >= c->fcount && c->fcount)
- return -1;
+ return AVERROR_EOF;
if(c->curframe != c->lastframe + 1){
avio_seek(s->pb, c->frames[c->curframe].pos, SEEK_SET);
@@ -151,8 +151,8 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
}
c->curbits = (curbits + size2) & 0x1F;
- if (av_new_packet(pkt, size) < 0)
- return AVERROR(EIO);
+ if ((ret = av_new_packet(pkt, size)) < 0)
+ return ret;
pkt->data[0] = curbits;
pkt->data[1] = (c->curframe > c->fcount) && c->fcount;
@@ -166,7 +166,7 @@ static int mpc_read_packet(AVFormatContext *s, AVPacket *pkt)
avio_seek(s->pb, -4, SEEK_CUR);
if(ret < size){
av_free_packet(pkt);
- return AVERROR(EIO);
+ return ret < 0 ? ret : AVERROR(EIO);
}
pkt->size = ret + 4;
@@ -214,7 +214,7 @@ static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
ret = av_read_frame(s, pkt);
if (ret < 0){
c->curframe = lastframe;
- return -1;
+ return ret;
}
av_free_packet(pkt);
}