mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-06-05 22:39:13 +02:00
Allow reading wav files with a 0 bytes RIFF chunk
This is required in order to read streamed wav files produced by the libavformat wav muxer.
This commit is contained in:
@@ -83,6 +83,10 @@ void* wav_read_open(const char *filename) {
|
|||||||
if (feof(wr->wav))
|
if (feof(wr->wav))
|
||||||
break;
|
break;
|
||||||
length = read_int32(wr);
|
length = read_int32(wr);
|
||||||
|
if (!length) {
|
||||||
|
wr->streamed = 1;
|
||||||
|
length = ~0;
|
||||||
|
}
|
||||||
if (tag != TAG('R', 'I', 'F', 'F') || length < 4) {
|
if (tag != TAG('R', 'I', 'F', 'F') || length < 4) {
|
||||||
fseek(wr->wav, length, SEEK_CUR);
|
fseek(wr->wav, length, SEEK_CUR);
|
||||||
continue;
|
continue;
|
||||||
@@ -118,7 +122,7 @@ void* wav_read_open(const char *filename) {
|
|||||||
} else if (subtag == TAG('d', 'a', 't', 'a')) {
|
} else if (subtag == TAG('d', 'a', 't', 'a')) {
|
||||||
data_pos = ftell(wr->wav);
|
data_pos = ftell(wr->wav);
|
||||||
wr->data_length = sublength;
|
wr->data_length = sublength;
|
||||||
if (!wr->data_length) {
|
if (!wr->data_length || wr->streamed) {
|
||||||
wr->streamed = 1;
|
wr->streamed = 1;
|
||||||
return wr;
|
return wr;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user