I have two OGG files here created with the same encoder. Both play with VLC and decode with oggdec.
However, one of them reports a zero length when loaded with the JUCE decoder (and also crashes the demo app) and the other does not.
Anyone seen any similar problems? I have a good few examples of these! I don’t know if it’s an encoding or decoding problem…
$ ogginfo *ogg
Processing file "53884c2935e6b47938f91ca78b0c2473a85730833138370caedbb66a74995130.ogg"...
New logical stream (#1, serial: 7cf3a216): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: Lavf53.32.100
Channels: 2
Rate: 44100
Nominal bitrate: 112.000000 kb/s
Upper bitrate not set
Lower bitrate not set
User comments section follows...
encoder=Lavf53.32.100
Vorbis stream 1:
Total data length: 477236 bytes
Playback length: 0m:28.000s
Average bitrate: 136.351376 kb/s
Logical stream 1 ended
Processing file "d7d5ef8e6c7fad33f922924d0a05591277654d53941d43518f1fe8580c7ea3f9.ogg"...
New logical stream (#1, serial: 4cc3ef76): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: Lavf53.32.100
Channels: 2
Rate: 44100
Nominal bitrate: 112.000000 kb/s
Upper bitrate not set
Lower bitrate not set
User comments section follows...
encoder=Lavf53.32.100
Vorbis stream 1:
Total data length: 486627 bytes
Playback length: 0m:26.000s
Average bitrate: 149.728251 kb/s
Logical stream 1 ended
Specifically, this function returns 0 for the troublesome example:
/* returns: total PCM length (samples) of content if i==-1 PCM length
(samples) of that logical bitstream for i==0 to n
OV_EINVAL if the stream is not seekable (we can't know the
length) or only partially open
*/
ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
if(vf->ready_state<OPENED)return(OV_EINVAL);
if(!vf->seekable || i>=vf->links)return(OV_EINVAL);
if(i<0){
ogg_int64_t acc=0;
int i;
for(i=0;i<vf->links;i++)
acc+=ov_pcm_total(vf,i);
return(acc);
}else{
return(vf->pcmlengths[i*2+1]);
}
}