mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-17 13:04:50 +00:00
mpc8: return more meaningful error codes.
This commit is contained in:
parent
263dbe9d95
commit
f2ed006c90
@ -202,7 +202,7 @@ static int mpc8_read_header(AVFormatContext *s)
|
|||||||
c->header_pos = avio_tell(pb);
|
c->header_pos = avio_tell(pb);
|
||||||
if(avio_rl32(pb) != TAG_MPCK){
|
if(avio_rl32(pb) != TAG_MPCK){
|
||||||
av_log(s, AV_LOG_ERROR, "Not a Musepack8 file\n");
|
av_log(s, AV_LOG_ERROR, "Not a Musepack8 file\n");
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(!pb->eof_reached){
|
while(!pb->eof_reached){
|
||||||
@ -214,14 +214,14 @@ static int mpc8_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
if(tag != TAG_STREAMHDR){
|
if(tag != TAG_STREAMHDR){
|
||||||
av_log(s, AV_LOG_ERROR, "Stream header not found\n");
|
av_log(s, AV_LOG_ERROR, "Stream header not found\n");
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
pos = avio_tell(pb);
|
pos = avio_tell(pb);
|
||||||
avio_skip(pb, 4); //CRC
|
avio_skip(pb, 4); //CRC
|
||||||
c->ver = avio_r8(pb);
|
c->ver = avio_r8(pb);
|
||||||
if(c->ver != 8){
|
if(c->ver != 8){
|
||||||
av_log(s, AV_LOG_ERROR, "Unknown stream version %d\n", c->ver);
|
av_log(s, AV_LOG_ERROR, "Unknown stream version %d\n", c->ver);
|
||||||
return -1;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
c->samples = ffio_read_varlen(pb);
|
c->samples = ffio_read_varlen(pb);
|
||||||
ffio_read_varlen(pb); //silence samples at the beginning
|
ffio_read_varlen(pb); //silence samples at the beginning
|
||||||
|
Loading…
Reference in New Issue
Block a user