shithub: hantro9

Download patch

ref: 6d9c27e525cb86a650ff7d4fc82fc27bb74fd59c
parent: a15e8798f07b778144f60562643e8c826a7e77b3
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue May 2 22:54:26 EDT 2023

more

--- a/ivfh264.c
+++ b/ivfh264.c
@@ -754,7 +754,7 @@
 
 		if(v.nal_unit_type == 8){ /* have sps+pps */
 			s = smprint(
-				"decode h264\n"
+				"decode h.264\n"
 				"sps pic_height_in_map_units_minus1 %d\n"
 				"sps pic_width_in_mbs_minus1 %d\n"
 				"sps chroma_format_idc %d\n"
@@ -807,7 +807,7 @@
 				v.pps.pic_parameter_set_id
 			);
 			if(pwrite(vpu, s, strlen(s), 0) < 0)
-				sysfatal("%r");
+				sysfatal("sps+pps: %r");
 			free(s);
 			shgo = 1;
 		}else if(shgo){
@@ -836,11 +836,16 @@
 				v.sh.bottom_field_flag
 			);
 			if(pwrite(vpu, s, strlen(s), 0) < 0)
-				sysfatal("%r");
+				sysfatal("sh: %r");
 			Bseek(&in, off, 0);
 			Bread(&in, buf, sz);
-			pwrite(vpu, buf, sz, -1);
-			pread(vpu, buf, 0, 0);
+			if(pwrite(vpu, buf, sz, 1) < 0)
+				sysfatal("data: %r");
+			if(pread(vpu, buf, 0, 0) < 0){
+				sleep(1000);
+				sysfatal("read: %r");
+			}
+			sleep(1000);
 		}
 
 		Bseek(&in, off+sz, 0);