正在显示
1 个修改的文件
包含
7 行增加
和
14 行删除
@@ -353,7 +353,6 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) | @@ -353,7 +353,6 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) | ||
353 | int ibpframe_size = avs->size() - avs->pos(); | 353 | int ibpframe_size = avs->size() - avs->pos(); |
354 | 354 | ||
355 | // send each frame. | 355 | // send each frame. |
356 | - bool got_sps_pps = false; | ||
357 | while (!avs->empty()) { | 356 | while (!avs->empty()) { |
358 | char* frame = NULL; | 357 | char* frame = NULL; |
359 | int frame_size = 0; | 358 | int frame_size = 0; |
@@ -370,8 +369,6 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) | @@ -370,8 +369,6 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) | ||
370 | 369 | ||
371 | // for sps | 370 | // for sps |
372 | if (avc->is_sps(frame, frame_size)) { | 371 | if (avc->is_sps(frame, frame_size)) { |
373 | - got_sps_pps = true; | ||
374 | - | ||
375 | std::string sps; | 372 | std::string sps; |
376 | if ((ret = avc->sps_demux(frame, frame_size, sps)) != ERROR_SUCCESS) { | 373 | if ((ret = avc->sps_demux(frame, frame_size, sps)) != ERROR_SUCCESS) { |
377 | return ret; | 374 | return ret; |
@@ -409,19 +406,15 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) | @@ -409,19 +406,15 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsStream* avs) | ||
409 | } | 406 | } |
410 | continue; | 407 | continue; |
411 | } | 408 | } |
412 | - | ||
413 | - break; | 409 | + |
410 | + // ibp frame. | ||
411 | + srs_info("mpegts: demux avc ibp frame size=%d, dts=%d", ibpframe_size, dts); | ||
412 | + if ((ret = write_h264_ipb_frame(frame, frame_size, dts, pts)) != ERROR_SUCCESS) { | ||
413 | + return ret; | ||
414 | + } | ||
414 | } | 415 | } |
415 | 416 | ||
416 | - // not ibp frame, ignore for already sent. | ||
417 | - if (got_sps_pps) { | ||
418 | - srs_info("mpegts: already send the sps/pps."); | ||
419 | - return ret; | ||
420 | - } | ||
421 | - | ||
422 | - // ibp frame. | ||
423 | - srs_info("mpegts: demux avc ibp frame size=%d, dts=%d", ibpframe_size, dts); | ||
424 | - return write_h264_ipb_frame(ibpframe, ibpframe_size, dts, pts); | 417 | + return ret; |
425 | } | 418 | } |
426 | 419 | ||
427 | int SrsMpegtsOverUdp::write_h264_sps_pps(u_int32_t dts, u_int32_t pts) | 420 | int SrsMpegtsOverUdp::write_h264_sps_pps(u_int32_t dts, u_int32_t pts) |
-
请 注册 或 登录 后发表评论