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."
This commit is contained in:
Augustin Cavalier 2018-09-23 16:55:54 -04:00
parent 1fb7ddbb1e
commit 6c73846a03
1 changed files with 3 additions and 2 deletions

View File

@ -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)) {