Stop stream immediately on quit
If the stream is stopped, av_read_frame() will be woken up and yield a corrupted packet. Do not try to decode or record it.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <SDL2/SDL_atomic.h>
|
||||
#include <SDL2/SDL_thread.h>
|
||||
|
||||
#include "net.h"
|
||||
@@ -18,6 +19,7 @@ struct stream {
|
||||
socket_t socket;
|
||||
struct video_buffer *video_buffer;
|
||||
SDL_Thread *thread;
|
||||
SDL_atomic_t stopped;
|
||||
struct decoder *decoder;
|
||||
struct recorder *recorder;
|
||||
struct receiver_state {
|
||||
|
||||
Reference in New Issue
Block a user