Skip to content

Commit

Permalink
Fix ossrs#2570, remove useless audio track info in PMT when no audio …
Browse files Browse the repository at this point in the history
…and refine code
  • Loading branch information
root authored and root committed Nov 18, 2021
1 parent 8adaae6 commit 2d2d6d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions trunk/src/kernel/srs_kernel_ts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2623,7 +2623,7 @@ srs_error_t SrsTsContextWriter::write_audio(SrsTsMessage* audio)
if (!ts_cache_msg_verifying_done) {
// video codec is not verified
if (vcodec == SrsVideoCodecIdForbidden) {
if (ts_msg_cache_for_verify_codec.size() < SRS_CONSTS_TS_MUXER_MSG_CACHE_COUT) {
if (ts_msg_cache_for_verify_codec.size() < SRS_CONSTS_TS_MUXER_MSG_CACHE_COUNT) {
ts_msg_cache_for_verify_codec.push_back(audio->detach());
return err;
} else {
Expand Down Expand Up @@ -2658,7 +2658,7 @@ srs_error_t SrsTsContextWriter::write_video(SrsTsMessage* video)
if (!ts_cache_msg_verifying_done) {
// audio codec is not verified
if (acodec == SrsAudioCodecIdForbidden) {
if (ts_msg_cache_for_verify_codec.size() < SRS_CONSTS_TS_MUXER_MSG_CACHE_COUT) {
if (ts_msg_cache_for_verify_codec.size() < SRS_CONSTS_TS_MUXER_MSG_CACHE_COUNT) {
ts_msg_cache_for_verify_codec.push_back(video->detach());
return err;
} else {
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/kernel/srs_kernel_ts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SrsTsContext;
#define SRS_CONSTS_HLS_PURE_AUDIO_AGGREGATE 720 * 90

// The ts muxer cache count for verifying the codec.
#define SRS_CONSTS_TS_MUXER_MSG_CACHE_COUT 50
#define SRS_CONSTS_TS_MUXER_MSG_CACHE_COUNT 50

// The pid of ts packet,
// Table 2-3 - PID table, hls-mpeg-ts-iso13818-1.pdf, page 37
Expand Down

0 comments on commit 2d2d6d7

Please sign in to comment.