Recomputing play length of a downloading mp3

Steve Tone <[email protected]>
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
This was also posted on the plugin development forum.

I may have a unique situation here, but would appreciate any help that you could give.

I have a script that "captures" an internet radio station's mp3 streaming audio for 3 hours at a particular time (fcron) using curl to retrieve the stream and write it to disk. I can then play the file at my leisure ("time shifting"), using xmms. And everything works great...

I have also modified an existing plugin ("HotKey" -- thank you!) to skip forward 60 seconds at a time by pressing a key, so that I may skip the commercials. And everything works great...

However, there are times when I begin listening to the file prior to it being completely downloaded. And still, everything works great...

Now the challenge. Apparently xmms only computes the play length once, when the file is first opened. However, the length of the file that I am playing is changing (lengthening). And, since I'm skipping ahead in the file, there are times when I'll reach the end of the play time as it was originally computed. xmms does not let me continue to skip forward past this point, even though the file is much longer than it originally was. It does, however, continue to play the file.

Of course, this behavior make sense for a fixed length file. But, I am looking for a way to force a recomputation of that play length, using the current file size, prior to skipping forward in the file. I've been pouring through the code for a few hours, and can't quite see the proper approach yet. Although I am a retired programmer, and haven't coded in c for 20 years, I still remember enough to get me in trouble, so am not afraid to patch the code, if only I knew what internal function to call to force recomputation this play length. Any ideas?

-- 
Steve Tone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.