提交 160b44e4 编写于 作者: J Jim

Merge pull request #71 from fryshorts/master

Some minor fixes
......@@ -367,6 +367,7 @@ void video_output_stop(video_t video)
return;
if (video->initialized) {
video->initialized = false;
os_event_signal(video->stop_event);
pthread_join(video->thread, &thread_ret);
os_event_signal(video->update_event);
......
......@@ -17,7 +17,7 @@
******************************************************************************/
/* Here we use xinerama to fetch data about monitor geometry
* Even if there are not multiple monitors, this should still work.
* Even if there are not multiple monitors, this should still work.
*/
#include <X11/Xlib.h>
......@@ -75,7 +75,7 @@ void GetMonitors(vector<MonitorInfo> &monitors)
screens = XineramaQueryScreens(display, &num_screens);
if (num_screens == 0 || !screens) {
if (num_screens == 0 || !screens) {
printf("Xinerama isn't active on this screen.\n");
return;
}
......@@ -86,13 +86,14 @@ void GetMonitors(vector<MonitorInfo> &monitors)
--num_screens;
monitors.emplace_back(
screens[num_screens].x_org,
screens[num_screens].x_org,
screens[num_screens].y_org,
screens[num_screens].width,
screens[num_screens].height
);
} while (num_screens > 0);
XFree(screens);
XCloseDisplay(display);
}
......
......@@ -84,17 +84,21 @@ static inline void free_packets(struct rtmp_stream *stream)
}
}
static void rtmp_stream_stop(void *data);
static void rtmp_stream_destroy(void *data)
{
struct rtmp_stream *stream = data;
if (stream->active)
rtmp_stream_stop(data);
if (stream) {
free_packets(stream);
dstr_free(&stream->path);
dstr_free(&stream->key);
dstr_free(&stream->username);
dstr_free(&stream->password);
RTMP_Close(&stream->rtmp);
os_event_destroy(stream->stop_event);
os_sem_destroy(stream->send_sem);
pthread_mutex_destroy(&stream->packets_mutex);
......@@ -144,6 +148,7 @@ static void rtmp_stream_stop(void *data)
obs_output_end_data_capture(stream->output);
os_sem_post(stream->send_sem);
pthread_join(stream->send_thread, &ret);
RTMP_Close(&stream->rtmp);
}
os_event_reset(stream->stop_event);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册