v1siuol commented on a change in pull request #1505:
URL: https://github.com/apache/incubator-brpc/pull/1505#discussion_r683843677



##########
File path: src/brpc/rtmp.cpp
##########
@@ -63,15 +63,19 @@ FlvWriter::FlvWriter(butil::IOBuf* buf)
     : _write_header(false), _buf(buf) {
 }
 
-static char g_flv_header[9] = { 'F', 'L', 'V', 0x01, 0x05, 0, 0, 0, 0x09 };
+FlvWriter::FlvWriter(butil::IOBuf* buf, const FlvWriterOptions& options)
+    : _write_header(false), _buf(buf) {
+    const int flags_bit_index = 4;
+    _header[flags_bit_index] = static_cast<uint8_t>(options.flv_content_type);
+}
 
 butil::Status FlvWriter::Write(const RtmpVideoMessage& msg) {

Review comment:
       Thanks for your feedback. It prompts that "cannot convert that enum type 
to char in initialization", so I do a type casting in 
d8003ebe34ecc73bb4d6806b455078afd1cd5b81. Please let me know if you have any 
concerns.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to