--- STREAM TRACK --- Attempt to stream from the indicated URL.
| 481 | // --- STREAM TRACK --- |
| 482 | // Attempt to stream from the indicated URL. |
| 483 | bool streamTrack(std::string url) { |
| 484 | // TODO: Check that we're not still streaming, otherwise queue the URL. |
| 485 | // TODO: allow to cancel any currently playing track/empty queue? |
| 486 | if (ffplay.playbackActive()) { |
| 487 | // Add to queue. |
| 488 | DataBuffer::addStreamTrack(url); |
| 489 | |
| 490 | return true; |
| 491 | } |
| 492 | |
| 493 | // Schedule next track URL. |
| 494 | ffplay.streamTrack(url); |
| 495 | |
| 496 | // Send status update to client. |
| 497 | sendStatusUpdate(DataBuffer::getSessionHandle()); |
| 498 | |
| 499 | return true; |
| 500 | } |
| 501 | |
| 502 | |
| 503 | void signal_handler(int signal) { |
no test coverage detected