mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	Build: Fix build warnings (#3302)
1. Avoid default guess for expression. 2. Force to void* for memset.
This commit is contained in:
		
							parent
							
								
									72182865ef
								
							
						
					
					
						commit
						476a32d417
					
				
					 3 changed files with 10 additions and 10 deletions
				
			
		| 
						 | 
					@ -624,7 +624,7 @@ srs_error_t SrsGopCache::cache(SrsSharedPtrMessage* shared_msg)
 | 
				
			||||||
        // Drop video when not h.264 or h.265.
 | 
					        // Drop video when not h.264 or h.265.
 | 
				
			||||||
        bool codec_ok = SrsFlvVideo::h264(msg->payload, msg->size);
 | 
					        bool codec_ok = SrsFlvVideo::h264(msg->payload, msg->size);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
        codec_ok = codec_ok ? : SrsFlvVideo::hevc(msg->payload, msg->size);
 | 
					        codec_ok = codec_ok ? true : SrsFlvVideo::hevc(msg->payload, msg->size);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
        if (!codec_ok) return err;
 | 
					        if (!codec_ok) return err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -165,7 +165,7 @@ bool SrsFlvVideo::sh(char* data, int size)
 | 
				
			||||||
    // Check sequence header only for H.264 or H.265
 | 
					    // Check sequence header only for H.264 or H.265
 | 
				
			||||||
    bool codec_ok = h264(data, size);
 | 
					    bool codec_ok = h264(data, size);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok? : hevc(data, size);
 | 
					    codec_ok = codec_ok? true : hevc(data, size);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (!codec_ok) return false;
 | 
					    if (!codec_ok) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -778,7 +778,7 @@ srs_error_t SrsFormat::on_video(int64_t timestamp, char* data, int size)
 | 
				
			||||||
    // Check codec for H.264 and H.265.
 | 
					    // Check codec for H.264 and H.265.
 | 
				
			||||||
    bool codec_ok = (codec_id == SrsVideoCodecIdAVC);
 | 
					    bool codec_ok = (codec_id == SrsVideoCodecIdAVC);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok ? : (codec_id == SrsVideoCodecIdHEVC);
 | 
					    codec_ok = codec_ok ? true : (codec_id == SrsVideoCodecIdHEVC);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (!codec_ok) return err;
 | 
					    if (!codec_ok) return err;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
| 
						 | 
					@ -851,7 +851,7 @@ srs_error_t SrsFormat::video_avc_demux(SrsBuffer* stream, int64_t timestamp)
 | 
				
			||||||
    // Check codec for H.264 and H.265.
 | 
					    // Check codec for H.264 and H.265.
 | 
				
			||||||
    bool codec_ok = (codec_id == SrsVideoCodecIdAVC);
 | 
					    bool codec_ok = (codec_id == SrsVideoCodecIdAVC);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok ? : (codec_id == SrsVideoCodecIdHEVC);
 | 
					    codec_ok = codec_ok ? true : (codec_id == SrsVideoCodecIdHEVC);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (!codec_ok) {
 | 
					    if (!codec_ok) {
 | 
				
			||||||
        return srs_error_new(ERROR_HLS_DECODE_ERROR, "only support video H.264/H.265, actual=%d", codec_id);
 | 
					        return srs_error_new(ERROR_HLS_DECODE_ERROR, "only support video H.264/H.265, actual=%d", codec_id);
 | 
				
			||||||
| 
						 | 
					@ -1174,7 +1174,7 @@ srs_error_t SrsFormat::hevc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // profile tier level...
 | 
					    // profile tier level...
 | 
				
			||||||
    SrsHevcSpsProfileTierLevel profile_tier_level;
 | 
					    SrsHevcSpsProfileTierLevel profile_tier_level;
 | 
				
			||||||
    memset(&profile_tier_level, 0, sizeof(SrsHevcSpsProfileTierLevel));
 | 
					    memset((void*)&profile_tier_level, 0, sizeof(SrsHevcSpsProfileTierLevel));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((err = hevc_demux_sps_rbsp_ptl(&bs, &profile_tier_level, 1, sps_max_sub_layers_minus1)) != srs_success) {
 | 
					    if ((err = hevc_demux_sps_rbsp_ptl(&bs, &profile_tier_level, 1, sps_max_sub_layers_minus1)) != srs_success) {
 | 
				
			||||||
        return srs_error_wrap(err, "sps rbsp ptl sps_max_sub_layers_minus1=%d", sps_max_sub_layers_minus1);
 | 
					        return srs_error_wrap(err, "sps rbsp ptl sps_max_sub_layers_minus1=%d", sps_max_sub_layers_minus1);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -371,7 +371,7 @@ srs_error_t SrsTsContext::encode_pat_pmt(ISrsStreamWriter* writer, int16_t vpid,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool codec_ok = (vs == SrsTsStreamVideoH264 || as == SrsTsStreamAudioAAC || as == SrsTsStreamAudioMp3);
 | 
					    bool codec_ok = (vs == SrsTsStreamVideoH264 || as == SrsTsStreamAudioAAC || as == SrsTsStreamAudioMp3);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok ? : (vs == SrsTsStreamVideoHEVC);
 | 
					    codec_ok = codec_ok ? true : (vs == SrsTsStreamVideoHEVC);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (!codec_ok) {
 | 
					    if (!codec_ok) {
 | 
				
			||||||
        return srs_error_new(ERROR_HLS_NO_STREAM, "ts: no PID, vs=%d, as=%d", vs, as);
 | 
					        return srs_error_new(ERROR_HLS_NO_STREAM, "ts: no PID, vs=%d, as=%d", vs, as);
 | 
				
			||||||
| 
						 | 
					@ -445,7 +445,7 @@ srs_error_t SrsTsContext::encode_pes(ISrsStreamWriter* writer, SrsTsMessage* msg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool codec_ok = (sid == SrsTsStreamVideoH264 || sid == SrsTsStreamAudioAAC || sid == SrsTsStreamAudioMp3);
 | 
					    bool codec_ok = (sid == SrsTsStreamVideoH264 || sid == SrsTsStreamAudioAAC || sid == SrsTsStreamAudioMp3);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok ? : (sid == SrsTsStreamVideoHEVC);
 | 
					    codec_ok = codec_ok ? true : (sid == SrsTsStreamVideoHEVC);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (!codec_ok) {
 | 
					    if (!codec_ok) {
 | 
				
			||||||
        srs_info("ts: ignore the unknown stream, sid=%d", sid);
 | 
					        srs_info("ts: ignore the unknown stream, sid=%d", sid);
 | 
				
			||||||
| 
						 | 
					@ -775,7 +775,7 @@ SrsTsPacket* SrsTsPacket::create_pmt(SrsTsContext* context,
 | 
				
			||||||
    // Here we must get the correct codec.
 | 
					    // Here we must get the correct codec.
 | 
				
			||||||
    bool codec_ok = (vs == SrsTsStreamVideoH264 || as == SrsTsStreamAudioAAC || as == SrsTsStreamAudioMp3);
 | 
					    bool codec_ok = (vs == SrsTsStreamVideoH264 || as == SrsTsStreamAudioAAC || as == SrsTsStreamAudioMp3);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok ? : (vs == SrsTsStreamVideoHEVC);
 | 
					    codec_ok = codec_ok ? true : (vs == SrsTsStreamVideoHEVC);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    srs_assert(codec_ok);
 | 
					    srs_assert(codec_ok);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -790,7 +790,7 @@ SrsTsPacket* SrsTsPacket::create_pmt(SrsTsContext* context,
 | 
				
			||||||
    // If h.264/h.265 specified, use video to carry pcr.
 | 
					    // If h.264/h.265 specified, use video to carry pcr.
 | 
				
			||||||
    codec_ok = (vs == SrsTsStreamVideoH264);
 | 
					    codec_ok = (vs == SrsTsStreamVideoH264);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok ? : (vs == SrsTsStreamVideoHEVC);
 | 
					    codec_ok = codec_ok ? true : (vs == SrsTsStreamVideoHEVC);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (codec_ok) {
 | 
					    if (codec_ok) {
 | 
				
			||||||
        pmt->PCR_PID = vpid;
 | 
					        pmt->PCR_PID = vpid;
 | 
				
			||||||
| 
						 | 
					@ -3256,7 +3256,7 @@ srs_error_t SrsTsTransmuxer::write_video(int64_t timestamp, char* data, int size
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool codec_ok = (format->vcodec->id != SrsVideoCodecIdAVC);
 | 
					    bool codec_ok = (format->vcodec->id != SrsVideoCodecIdAVC);
 | 
				
			||||||
#ifdef SRS_H265
 | 
					#ifdef SRS_H265
 | 
				
			||||||
    codec_ok = codec_ok ? : (format->vcodec->id != SrsVideoCodecIdHEVC);
 | 
					    codec_ok = codec_ok ? true : (format->vcodec->id != SrsVideoCodecIdHEVC);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if (!codec_ok) {
 | 
					    if (!codec_ok) {
 | 
				
			||||||
        return err;
 | 
					        return err;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue