From 6c73846a038555f531ec37f16204ca90d40f64ad Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sun, 23 Sep 2018 16:55:54 -0400 Subject: [PATCH] MediaPlayer: Quit the VideoProducer when we reach the last buffer. Fixes #13622. The "media_node_framework" is such a huge mess. We really should sit down and design a MediaKit2 someday that doesn't require ~15,000 lines of media node support code just to have a "fully functioning media player." --- .../mediaplayer/media_node_framework/video/VideoProducer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp b/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp index 774dfc3ed2..a5fb4a1209 100644 --- a/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp +++ b/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp @@ -762,12 +762,13 @@ VideoProducer::_FrameGeneratorThread() err = B_OK; } // clean the buffer if something went wrong - if (err != B_OK) { + if (err != B_OK && err != B_LAST_BUFFER_ERROR) { // TODO: should use "back value" according // to color space! memset(buffer->Data(), 0, h->size_used); err = B_OK; - } + } else if (err == B_LAST_BUFFER_ERROR) + running = false; // Send the buffer on down to the consumer if (wasCached || (err = SendBuffer(buffer, fOutput.source, fOutput.destination) != B_OK)) {