mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #421, drop video for unkown RTMP header.
This commit is contained in:
parent
679b4317d8
commit
a1dd734318
4 changed files with 42 additions and 1 deletions
|
@ -266,6 +266,28 @@ bool SrsFlvCodec::audio_is_aac(char* data, int size)
|
|||
return sound_format == SrsCodecAudioAAC;
|
||||
}
|
||||
|
||||
bool SrsFlvCodec::video_is_acceptable(char* data, int size)
|
||||
{
|
||||
// 1bytes required.
|
||||
if (size < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
char frame_type = data[0];
|
||||
char codec_id = frame_type & 0x0f;
|
||||
frame_type = (frame_type >> 4) & 0x0f;
|
||||
|
||||
if (frame_type < 1 || frame_type > 5) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (codec_id < 2 || codec_id > 7) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
string srs_codec_avc_nalu2str(SrsAvcNaluType nalu_type)
|
||||
{
|
||||
switch (nalu_type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue