shithub: nvi

Download patch

ref: 8a9cb14d8ea294450b8f11124b30d228fc068471
parent: 64feeb1dc00e4293221873af8b99dc90768a0c2d
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jun 23 04:27:45 EDT 2021

peertube: display sample rate and number of channels

--- a/peertube.c
+++ b/peertube.c
@@ -56,8 +56,19 @@
 				t = jsonstr(x);
 				if(strcmp(t, "video") == 0)
 					fmt->included |= Ivideo;
-				else if(strcmp(t, "audio") == 0)
+				else if(strcmp(t, "audio") == 0){
 					fmt->included |= Iaudio;
+					if((x = jsonbyname(e->val, "sample_rate")) != nil){
+						t = smprint("%s,rate=%d", s, (int)x->n);
+						free(s);
+						s = t;
+					}
+					if((x = jsonbyname(e->val, "channels")) != nil){
+						t = smprint("%s,channels=%d", s, (int)x->n);
+						free(s);
+						s = t;
+					}
+				}
 			}
 		}
 	}