Fix codec check

pull/1587/head^2
winlin 5 years ago
parent 3900179685
commit 9ac8585cf9

@ -652,9 +652,9 @@ bool SrsFormat::is_aac_sequence_header()
bool SrsFormat::is_avc_sequence_header() bool SrsFormat::is_avc_sequence_header()
{ {
bool h264 = vcodec->id == SrsVideoCodecIdAVC; bool h264 = (vcodec && vcodec->id == SrsVideoCodecIdAVC);
bool h265 = vcodec->id == SrsVideoCodecIdHEVC; bool h265 = (vcodec && vcodec->id == SrsVideoCodecIdHEVC);
bool av1 = vcodec->id == SrsVideoCodecIdAV1; bool av1 = (vcodec && vcodec->id == SrsVideoCodecIdAV1);
return vcodec && (h264 || h265 || av1) return vcodec && (h264 || h265 || av1)
&& video && video->avc_packet_type == SrsVideoAvcFrameTraitSequenceHeader; && video && video->avc_packet_type == SrsVideoAvcFrameTraitSequenceHeader;
} }

Loading…
Cancel
Save