[Pidgin] #2663: Reset&unref GStreamer 'playbin' GstElement when errors occur

Pidgin trac at pidgin.im
Mon Aug 20 23:52:30 EDT 2007


#2663: Reset&unref GStreamer 'playbin' GstElement when errors occur
----------------------------------------------------------+-----------------
 Reporter:  QuLogic                                       |       Type:  patch
   Status:  new                                           |   Priority:  minor
Component:  pidgin (gtk)                                  |    Version:  2.1.0
 Keywords:  gstreamer, sound, too many open file handles  |    Pending:  0    
----------------------------------------------------------+-----------------
 According to [http://gstreamer.freedesktop.org/data/doc/gstreamer/head
 /gst-plugins-base-plugins/html/gst-plugins-base-plugins-playbin.html
 GStreamer docs] on the matter:
 {{{
 When playback has finished (an EOS message has been received on the bus)
 or an error has occurred (an ERROR message has been received on the bus)
 or the user wants to play a different track, playbin should be set back to
 READY or NULL state, then the "uri" property should be set to the new
 location and then playbin be set to PLAYING state again.
 }}}

 Pidgin/Finch only set the state to NULL when the playback finishes, but
 not when an error occurs. This results in the audio file handle not being
 closed, and subsequent sound events to stop working as well (even when the
 cause of the error has passed). Eventually, Pidgin just runs out of file
 handles entirely, killing logging, prefs saving, etc.

 Attached is a simple patch for Pidgin and Finch that resets and unrefs the
 !GstElement when errors occur. I have tested it with Pidgin, and after an
 error occurs (turning off ALSA), there are no longer any stray file
 handles. As well, after re-enabling ALSA, sound events then continue to
 work. The change to Finch is exactly the same, so it should work just as
 well.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/2663>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list