1
0
Эх сурвалжийг харах

obs-outputs: Change FLV tag size according to v10 spec

Ruwen Hahn 2 жил өмнө
parent
commit
bdd7d9cf53

+ 9 - 2
plugins/obs-outputs/flv-mux.c

@@ -212,8 +212,15 @@ static inline void write_previous_tag_size_without_header(struct serializer *s,
 							  uint32_t header_size)
 {
 	assert(serializer_get_pos(s) >= header_size);
-	/* write tag size (starting byte doesn't count) */
-	s_wb32(s, (uint32_t)serializer_get_pos(s) - header_size - 1);
+	assert(serializer_get_pos(s) >= 11);
+
+	/*
+	 * From FLV file format specification version 10:
+	 * Size of previous [current] tag, including its header.
+	 * For FLV version 1 this value is 11 plus the DataSize of
+	 * the previous [current] tag.
+	 */
+	s_wb32(s, (uint32_t)serializer_get_pos(s) - header_size);
 }
 
 static inline void write_previous_tag_size(struct serializer *s)