[haiku-commits] r38664 - haiku/trunk/src/apps/mediaplayer/media_node_framework/audio

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 16 Sep 2010 00:23:50 +0200 (CEST)

Author: stippi
Date: 2010-09-16 00:23:50 +0200 (Thu, 16 Sep 2010)
New Revision: 38664
Changeset: http://dev.haiku-os.org/changeset/38664

Modified:
   haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp
Log:
Always wait for buffers in AudioProducer::_FillNextBuffer().
Seems to work around a problem in the system mixer. When it
happens once that the AudioProducer does not send a buffer,
then it can eventually lead to a drop into the debugger
from BBuffer::SetHeader(), which to me looks like the BMediaEventLooper
thread of the mixer still runs when the System Mixer has been
shut down, which itself is yet another problem. I shall
investigate, but for the time being, one should enjoy a more
stable media_addon_server life-time.


Modified: 
haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp
===================================================================
--- 
haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp   
    2010-09-15 19:58:48 UTC (rev 38663)
+++ 
haiku/trunk/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp   
    2010-09-15 22:23:50 UTC (rev 38664)
@@ -645,13 +645,13 @@
                        if (RunState() == BMediaEventLooper::B_STARTED
                                && fOutput.destination != 
media_destination::null) {
                                BBuffer* buffer = 
_FillNextBuffer(event->event_time);
-                               if (buffer) {
+                               if (buffer != NULL) {
                                        status_t err = B_ERROR;
                                        if (fOutputEnabled) {
                                                err = SendBuffer(buffer, 
fOutput.source,
                                                        fOutput.destination);
                                        }
-                                       if (err)
+                                       if (err != B_OK)
                                                buffer->Recycle();
                                }
                                size_t sampleSize = 
fOutput.format.u.raw_audio.format
@@ -810,6 +810,7 @@
 BBuffer*
 AudioProducer::_FillNextBuffer(bigtime_t eventTime)
 {
+       fBufferGroup->WaitForBuffers();
        BBuffer* buffer = fBufferGroup->RequestBuffer(
                fOutput.format.u.raw_audio.buffer_size, BufferDuration());
 


Other related posts:

  • » [haiku-commits] r38664 - haiku/trunk/src/apps/mediaplayer/media_node_framework/audio - superstippi