shithub: treason

Download patch

ref: 2f4e78d223b2916ec92874e533d1a0308b065200
parent: 4e89369d48a1d9f9cabc072d82b77273ca427d6e
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Sep 15 10:17:10 EDT 2020

remove decoder's stop channel, frames channel is enough

--- a/decoder.c
+++ b/decoder.c
@@ -28,7 +28,6 @@
 	d->s = s;
 	d->frames = chancreate(sizeof(Frame*), 4);
 	d->finished = chancreate(sizeof(void*), 0);
-	d->stop = chancreate(sizeof(void*), 0);
 
 	for(i = 0; i < nelem(ops); i++){
 		if(ops[i].fmt == s->fmt){
@@ -53,7 +52,6 @@
 {
 	d->ops->close(d);
 	chanclose(d->frames);
-	sendp(d->stop, nil);
 	recvp(d->finished);
 	free(d);
 }
--- a/decoder.h
+++ b/decoder.h
@@ -5,7 +5,6 @@
 	Stream *s;
 	Channel *frames;
 	Channel *finished;
-	Channel *stop;
 	Decoderops *ops;
 	double timebase;
 
--- a/decoder_av1.c
+++ b/decoder_av1.c
@@ -55,7 +55,7 @@
 	lasttimestamp = 0;
 	memset(&pic, 0, sizeof(pic));
 	for(res = 0, data.sz = 0; data.sz > 0 || (res = readframe(d->s, &data)) == 0;){
-		if(nbrecvp(d->stop) != 0 || data.sz == 0)
+		if(data.sz == 0)
 			break;
 
 		res = dav1d_get_picture(a->c, &pic);
@@ -110,7 +110,6 @@
 
 	dav1d_close(&a->c);
 	free(a);
-	chanclose(d->stop);
 	c = d->finished;
 	sendp(c, nil);
 	chanclose(c);