]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7513: break is safer than continue
authorSeven Du <dujinfang@gmail.com>
Thu, 16 Apr 2015 02:15:56 +0000 (10:15 +0800)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:21 +0000 (12:47 -0500)
when the encoder returns 0, it means no more data will come and we should not try again

src/mod/applications/mod_conference/mod_conference.c
src/switch_core_media.c

index 70b34be6866bdab23d0769423ee7011fe546d6e9..6ffa314b863d6ec8618424260762c6d53fe370cc 100644 (file)
@@ -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) {
index 8b9ee13d54b2f23c7f11e833bd1afdf640117ab1..c7e8712dbba50a5a0c404bae49ea08fbac1f8c29 100644 (file)
@@ -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);