Notify viewers when channels close and refresh resumed playback state
This commit is contained in:
1 parent
4e1c36955a
commit
6e596f34a5
3 files changed
+5
-4
No files matched your search
@@ -141,8 +141,8 @@ void StreamPlayerWindow::tick() {
|
||||
}
|
||||
if (!image.isNull()) {
|
||||
m_render->setFrame(image);
|
||||
m_status->setText(text("Live"));
|
||||
if (!p.shown++) {
|
||||
m_status->setText(text("Live"));
|
||||
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "desktop first frame id=%llu %dx%d", (unsigned long long)p.id, image.width(), image.height());
|
||||
}
|
||||
emit framePresented();
|
||||
@@ -275,7 +275,8 @@ void StreamPlayerWindow::decode() {
|
||||
frame->width, frame->height, AV_PIX_FMT_RGB24, SWS_BILINEAR, nullptr, nullptr, nullptr);
|
||||
QImage image(frame->width, frame->height, QImage::Format_RGB888);
|
||||
if (!converter || image.isNull()) { fail(text("Stream decoder allocation failed")); p.running = false; break; }
|
||||
uint8_t* destination[] = {image.bits(), nullptr, nullptr, nullptr}; int strides[] = {image.bytesPerLine(), 0, 0, 0};
|
||||
uint8_t* destination[] = {image.bits(), nullptr, nullptr, nullptr};
|
||||
int strides[] = {static_cast<int>(image.bytesPerLine()), 0, 0, 0};
|
||||
if (sws_scale(converter, frame->data, frame->linesize, 0, frame->height, destination, strides) != frame->height) {
|
||||
fail(text("Stream video conversion failed")); p.running = false; break;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ bool gui_stream_attach(UTUN_INSTANCE* inst) {
|
||||
|
||||
void gui_stream_detach(UTUN_INSTANCE* inst) {
|
||||
std::lock_guard<std::mutex> guard(bridge.lock);
|
||||
if (bridge.inst != inst) return;
|
||||
if (!inst || bridge.inst != inst) return;
|
||||
if (bridge.pending) uasync_cancel_post(inst->ua, bridge.pending);
|
||||
bridge.pending = nullptr; stream_set_event_callback(inst, nullptr, nullptr);
|
||||
if (bridge.viewer.id) closeViewer(StreamRecordKind::Closed, STREAM_CLOSE_SERVICE);
|
||||
|
||||
Reference in new issue
Block a user