Implemented Enhanced Streaming (ogg only)
Davy Durham <[email protected]> Thu, 20 Jan 2005 01:17:42 -0600
| Newsgroups | gmane.comp.multimedia.xmms.devel |
|---|---|
| Message-ID | <[email protected]> |
Hey guys.. several days ago I emailed the list about being able to seek in a streaming file. Someone had already implemented it, but since Input plugins are implemented the way they are, it only worked for MP3s. So, I've completed an implementation for the vorbis plugin. I looked all over for other media players that could seek in streaming ogg streams (didn't bother testing mp3) and not, totem, xine, gstreamer, beep, nor any of the other little ones I tried have this capability. I think it is a distintive improvement over other players now in xmms. I completely changed how http.c works and how vorbis.c gets data from it. Now, http.c simply creates a tmpfile() (goes away when closed or if the process ends) and starts writing to it. vorbis.c simply reads from this file that it's writing to using a different file handle so that seek positions are independant. So, instead of a small RAM ring-buffer for transfering data from http.c to vorbis.c, a temp file is now used and is recording all history as it goes. Also, every second for the first 10 seconds, and every 5 seconds after that, the tmpfile is reopened on the read side of thins with vorbisfile in vorbis.c so that vorbisfile discovers any new data in the file... this allows me to ask vorbisfile again how long the file is now.. and I update the time variable so that the seek bar's max time actually changes while it's playing. Unfortunately there's know way of knowing the length in seconds of the stream before it's completly downloaded, so I cannot know what the total time will be in order to set the seek bar already for that amount of time. Bottom line: it changes while it plays as long as http.c is still downloading anything.. when it's finished downloading, things settle down. ===== It's so nice now, I can seek in files that I'm listening to from my music server. On a LAN environment the whole song downloads in a couple of seconds, so I don't notice anything. But when I limited the output rate from my server to like 12kB/s it still worked great, I just got a seek bar that changes while playing, but you can see the length of the stream increasing in the info window containing the title and such. I need to know the proper proceedure for submitting a patch, and wonder how long it might be before it can go into a mainline release. I understand it will need a bit of testing with others. It was stated that developement has slowed down somewhere, is this true? Thanks, Davy