[squeak-dev] MPEG plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] MPEG plugin

Steven W Riggins
Is anyone using the MPEG plugin for mp3 files?

We're noticing it lies in determining the duration, in samples, of a  
file.

I went perusing through the plugin source and found:

           result = (long)((float)mpeg3demuxer_total_bytes(audio-
 >astream->demuxer) / audio->avg_framesize * audio->samples_per_frame);

It seems that using an average frame size to calculate the # of  
samples is fraught with error, no?

Of course, this totally breaks all of code that plays from point A to  
point B, tries to keep the video in sync on scrubbing, etc, as we're  
using the audio samples to determine the duration of the file.  There  
does not seem to be another api in the plugin for returning the  
duration.

Thanks!

Steve