From: Seven Du Date: Thu, 16 Apr 2015 02:15:56 +0000 (+0800) Subject: FS-7513: break is safer than continue X-Git-Tag: v1.6.2~614^2~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30463bfc1ee2e5bb086849b2a9d7673ed105de92;p=thirdparty%2Ffreeswitch.git FS-7513: break is safer than continue when the encoder returns 0, it means no more data will come and we should not try again --- diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 70b34be686..6ffa314b86 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -1595,7 +1595,7 @@ static void write_canvas_image_to_codec_group(conference_obj_t *conference, code switch_assert((encode_status == SWITCH_STATUS_SUCCESS && frame->m) || !frame->m); if (frame->datalen == 0) { - continue; + break; } if (frame->timestamp) { diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 8b9ee13d54..c7e8712dbb 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -10393,7 +10393,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor frame->flags &= ~SFF_PICTURE_RESET; } - if (frame->datalen == 0) continue; + if (frame->datalen == 0) break; switch_set_flag(frame, SFF_RAW_RTP_PARSE_FRAME); status = switch_core_session_write_encoded_video_frame(session, frame, flags, stream_id);