FS-7513: don't write 0 data, openh264 might return 0

This commit is contained in:
Seven Du 2015-04-15 20:28:53 +08:00 committed by Michael Jerris
parent 7d60e6e868
commit 046798a057
2 changed files with 8 additions and 1 deletions

View File

@ -1593,6 +1593,11 @@ static void write_canvas_image_to_codec_group(conference_obj_t *conference, code
if (encode_status == SWITCH_STATUS_SUCCESS || encode_status == SWITCH_STATUS_MORE_DATA) { if (encode_status == SWITCH_STATUS_SUCCESS || encode_status == SWITCH_STATUS_MORE_DATA) {
switch_assert((encode_status == SWITCH_STATUS_SUCCESS && frame->m) || !frame->m); switch_assert((encode_status == SWITCH_STATUS_SUCCESS && frame->m) || !frame->m);
if (frame->datalen == 0) {
continue;
}
if (frame->timestamp) { if (frame->timestamp) {
switch_set_flag(frame, SFF_RAW_RTP_PARSE_FRAME); switch_set_flag(frame, SFF_RAW_RTP_PARSE_FRAME);
} }

View File

@ -10393,6 +10393,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor
frame->flags &= ~SFF_PICTURE_RESET; frame->flags &= ~SFF_PICTURE_RESET;
} }
if (frame->datalen == 0) continue;
switch_set_flag(frame, SFF_RAW_RTP_PARSE_FRAME); switch_set_flag(frame, SFF_RAW_RTP_PARSE_FRAME);
status = switch_core_session_write_encoded_video_frame(session, frame, flags, stream_id); status = switch_core_session_write_encoded_video_frame(session, frame, flags, stream_id);
} }