Skip to content

Commit 1081270

Browse files
authored
Update main.cpp
adds termination via ctrl-c
1 parent 94e3606 commit 1081270

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,12 @@ void read_gstreamerpipe_stream(MppPacket *packet, int gst_udp_port, const VideoC
396396
GstRtpReceiver receiver(gst_udp_port, codec);
397397
long long bytes_received = 0;
398398
uint64_t period_start=0;
399-
auto cb=[&packet,/*&decoder_stalled_count,*/ &bytes_received, &period_start](std::shared_ptr<std::vector<uint8_t>> frame){
399+
auto cb=[&packet,/*&decoder_stalled_count,*/ &bytes_received, &period_start, &signal_flag](std::shared_ptr<std::vector<uint8_t>> frame){
400+
401+
if (signal_flag) {
402+
return;
403+
}
404+
400405
// Let the gst pull thread run at quite high priority
401406
static bool first= false;
402407
if(first){

0 commit comments

Comments
 (0)