1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Remove unreachable issues in code (#3793)

remove unreachable links by python scripts:
```
def is_delete_issue(link):
    try:
        response = requests.get(link)
    except RequestException as e:
        print(f"An error occurred while trying to get the link: {e}")
        return False

    return "This issue has been deleted." in response.text


def remove_unreachable_links(dir):
    string_to_search = re.compile(r'// @see https://github\.com/ossrs/srs/issues/.*')
    file_list = util.find_files_with_extension(dir, ".cpp", True)
    for file in file_list:
        lines = []
        with open(file, "r", encoding="utf-8") as f:
            lines = f.readlines()
        with open(file, "w", encoding="utf-8", newline="\n") as f:    
            for line in lines:
                if string_to_search.search(line):
                    result = re.search(r'https://github\.com/ossrs/srs/issues/\d+', line)
                    if result:
                        link = result.group()
                        if is_delete_issue(link):
                            print("is_delete_issue link: file: %s, line: %s" % (file, line))
                            continue
                    
                f.write(line)

if __name__ == "__main__":
    remove_unreachable_links("srs/trunk/src/")
```
This commit is contained in:
Haibo Chen 2023-09-04 16:31:54 +08:00 committed by GitHub
parent 7138edd318
commit 6e6b80d837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 0 additions and 22 deletions

View file

@ -868,7 +868,6 @@ srs_error_t SrsDvrSegmentPlan::update_duration(SrsSharedPtrMessage* msg)
} }
// when wait keyframe, ignore if no frame arrived. // when wait keyframe, ignore if no frame arrived.
// @see https://github.com/ossrs/srs/issues/177
if (wait_keyframe) { if (wait_keyframe) {
if (!msg->is_video()) { if (!msg->is_video()) {
return err; return err;

View file

@ -201,7 +201,6 @@ srs_error_t SrsEdgeFlvUpstream::do_connect(SrsRequest* r, SrsLbRoundRobin* lb, i
if (redirect_depth == 0) { if (redirect_depth == 0) {
SrsConfDirective* conf = _srs_config->get_vhost_edge_origin(req->vhost); SrsConfDirective* conf = _srs_config->get_vhost_edge_origin(req->vhost);
// @see https://github.com/ossrs/srs/issues/79
// when origin is error, for instance, server is shutdown, // when origin is error, for instance, server is shutdown,
// then user remove the vhost then reload, the conf is empty. // then user remove the vhost then reload, the conf is empty.
if (!conf) { if (!conf) {

View file

@ -173,7 +173,6 @@ srs_error_t SrsFFMPEG::initialize_transcode(SrsConfDirective* engine)
// for not rtmp input, donot append the iformat, // for not rtmp input, donot append the iformat,
// for example, "-f flv" before "-i udp://192.168.1.252:2222" // for example, "-f flv" before "-i udp://192.168.1.252:2222"
// @see https://github.com/ossrs/srs/issues/290
if (!srs_string_starts_with(input, "rtmp://")) { if (!srs_string_starts_with(input, "rtmp://")) {
iformat = ""; iformat = "";
} }

View file

@ -554,7 +554,6 @@ bool SrsHlsMuxer::wait_keyframe()
bool SrsHlsMuxer::is_segment_absolutely_overflow() bool SrsHlsMuxer::is_segment_absolutely_overflow()
{ {
// @see https://github.com/ossrs/srs/issues/151#issuecomment-83553950
srs_assert(current); srs_assert(current);
// to prevent very small segment. // to prevent very small segment.
@ -812,7 +811,6 @@ srs_error_t SrsHlsMuxer::_refresh_m3u8(string m3u8_file)
* rounded to the nearest integer. Its value MUST NOT change. A * rounded to the nearest integer. Its value MUST NOT change. A
* typical target duration is 10 seconds. * typical target duration is 10 seconds.
*/ */
// @see https://github.com/ossrs/srs/issues/304#issuecomment-74000081
srs_utime_t max_duration = segments->max_duration(); srs_utime_t max_duration = segments->max_duration();
int target_duration = (int)ceil(srsu2msi(srs_max(max_duration, max_td)) / 1000.0); int target_duration = (int)ceil(srsu2msi(srs_max(max_duration, max_td)) / 1000.0);
@ -1025,9 +1023,7 @@ srs_error_t SrsHlsController::write_audio(SrsAudioFrame* frame, int64_t pts)
// for example, pure audio when start, audio/video when publishing, // for example, pure audio when start, audio/video when publishing,
// pure audio again for audio disabled. // pure audio again for audio disabled.
// so we reap event when the audio incoming when segment overflow. // so we reap event when the audio incoming when segment overflow.
// @see https://github.com/ossrs/srs/issues/151
// we use absolutely overflow of segment to make jwplayer/ffplay happy // we use absolutely overflow of segment to make jwplayer/ffplay happy
// @see https://github.com/ossrs/srs/issues/151#issuecomment-71155184
if (tsmc->audio && muxer->is_segment_absolutely_overflow()) { if (tsmc->audio && muxer->is_segment_absolutely_overflow()) {
if ((err = reap_segment()) != srs_success) { if ((err = reap_segment()) != srs_success) {
return srs_error_wrap(err, "hls: reap segment"); return srs_error_wrap(err, "hls: reap segment");

View file

@ -136,7 +136,6 @@ private:
// The video frames we got. // The video frames we got.
uint64_t video_frames; uint64_t video_frames;
// For mr(merged read), // For mr(merged read),
// @see https://github.com/ossrs/srs/issues/241
bool mr; bool mr;
int mr_fd; int mr_fd;
srs_utime_t mr_sleep; srs_utime_t mr_sleep;
@ -149,7 +148,6 @@ private:
// The params for conn callback. // The params for conn callback.
SrsLiveSource* _source; SrsLiveSource* _source;
// The error timeout cond // The error timeout cond
// @see https://github.com/ossrs/srs/issues/244
srs_cond_t error; srs_cond_t error;
// The merged context id. // The merged context id.
SrsContextId cid; SrsContextId cid;

View file

@ -1020,7 +1020,6 @@ srs_error_t SrsRtmpConn::do_publishing(SrsLiveSource* source, SrsPublishRecvThre
// cond wait for timeout. // cond wait for timeout.
if (nb_msgs == 0) { if (nb_msgs == 0) {
// when not got msgs, wait for a larger timeout. // when not got msgs, wait for a larger timeout.
// @see https://github.com/ossrs/srs/issues/441
rtrd->wait(publish_1stpkt_timeout); rtrd->wait(publish_1stpkt_timeout);
} else { } else {
rtrd->wait(publish_normal_timeout); rtrd->wait(publish_normal_timeout);

View file

@ -967,7 +967,6 @@ srs_error_t SrsOriginHub::on_audio(SrsSharedPtrMessage* shared_audio)
if ((err = hls->on_audio(msg, format)) != srs_success) { if ((err = hls->on_audio(msg, format)) != srs_success) {
// apply the error strategy for hls. // apply the error strategy for hls.
// @see https://github.com/ossrs/srs/issues/264
std::string hls_error_strategy = _srs_config->get_hls_on_error(req_->vhost); std::string hls_error_strategy = _srs_config->get_hls_on_error(req_->vhost);
if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) { if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) {
srs_warn("hls: ignore audio error %s", srs_error_desc(err).c_str()); srs_warn("hls: ignore audio error %s", srs_error_desc(err).c_str());
@ -1061,7 +1060,6 @@ srs_error_t SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_se
if ((err = hls->on_video(msg, format)) != srs_success) { if ((err = hls->on_video(msg, format)) != srs_success) {
// TODO: We should support more strategies. // TODO: We should support more strategies.
// apply the error strategy for hls. // apply the error strategy for hls.
// @see https://github.com/ossrs/srs/issues/264
std::string hls_error_strategy = _srs_config->get_hls_on_error(req_->vhost); std::string hls_error_strategy = _srs_config->get_hls_on_error(req_->vhost);
if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) { if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) {
srs_warn("hls: ignore video error %s", srs_error_desc(err).c_str()); srs_warn("hls: ignore video error %s", srs_error_desc(err).c_str());
@ -1629,7 +1627,6 @@ srs_error_t SrsMetaCache::dumps(SrsLiveConsumer* consumer, bool atc, SrsRtmpJitt
// copy sequence header // copy sequence header
// copy audio sequence first, for hls to fast parse the "right" audio codec. // copy audio sequence first, for hls to fast parse the "right" audio codec.
// @see https://github.com/ossrs/srs/issues/301
if (aformat && aformat->acodec && aformat->acodec->id != SrsAudioCodecIdMP3) { if (aformat && aformat->acodec && aformat->acodec->id != SrsAudioCodecIdMP3) {
if (ds && audio && (err = consumer->enqueue(audio, atc, ag)) != srs_success) { if (ds && audio && (err = consumer->enqueue(audio, atc, ag)) != srs_success) {
return srs_error_wrap(err, "enqueue audio sh"); return srs_error_wrap(err, "enqueue audio sh");
@ -1858,7 +1855,6 @@ srs_error_t SrsLiveSourceManager::notify(int event, srs_utime_t interval, srs_ut
// TODO: FIXME: support source cleanup. // TODO: FIXME: support source cleanup.
// @see https://github.com/ossrs/srs/issues/713 // @see https://github.com/ossrs/srs/issues/713
// @see https://github.com/ossrs/srs/issues/714
#if 0 #if 0
// When source expired, remove it. // When source expired, remove it.
if (source->stream_is_dead()) { if (source->stream_is_dead()) {

View file

@ -115,7 +115,6 @@ srs_error_t SrsAacTransmuxer::write_audio(int64_t timestamp, char* data, int siz
// write the ADTS header. // write the ADTS header.
// @see ISO_IEC_14496-3-AAC-2001.pdf, page 75, // @see ISO_IEC_14496-3-AAC-2001.pdf, page 75,
// 1.A.2.2 Audio_Data_Transport_Stream frame, ADTS // 1.A.2.2 Audio_Data_Transport_Stream frame, ADTS
// @see https://github.com/ossrs/srs/issues/212#issuecomment-64145885
// byte_alignment() // byte_alignment()
// adts_fixed_header: // adts_fixed_header:

View file

@ -1258,7 +1258,6 @@ class SrsTsContextWriter
{ {
private: private:
// User must config the codec in right way. // User must config the codec in right way.
// @see https://github.com/ossrs/srs/issues/301
SrsVideoCodecId vcodec_; SrsVideoCodecId vcodec_;
SrsAudioCodecId acodec_; SrsAudioCodecId acodec_;
private: private:

View file

@ -1118,7 +1118,6 @@ int SrsIngestHlsOutput::write_h264_ipb_frame(string ibps, SrsVideoAvcFrameType f
srs_error_t err = srs_success; srs_error_t err = srs_success;
// when sps or pps not sent, ignore the packet. // when sps or pps not sent, ignore the packet.
// @see https://github.com/ossrs/srs/issues/203
if (!h264_sps_pps_sent) { if (!h264_sps_pps_sent) {
return ERROR_H264_DROP_BEFORE_SPS_PPS; return ERROR_H264_DROP_BEFORE_SPS_PPS;
} }

View file

@ -184,7 +184,6 @@ public:
// @param data, the data to send. NULL to flush header only. // @param data, the data to send. NULL to flush header only.
virtual srs_error_t write(char* data, int size) = 0; virtual srs_error_t write(char* data, int size) = 0;
// for the HTTP FLV, to writev to improve performance. // for the HTTP FLV, to writev to improve performance.
// @see https://github.com/ossrs/srs/issues/405
virtual srs_error_t writev(const iovec* iov, int iovcnt, ssize_t* pnwrite) = 0; virtual srs_error_t writev(const iovec* iov, int iovcnt, ssize_t* pnwrite) = 0;
// WriteHeader sends an HTTP response header with status code. // WriteHeader sends an HTTP response header with status code.
@ -261,7 +260,6 @@ public:
// @param data, the data to send. NULL to flush header only. // @param data, the data to send. NULL to flush header only.
virtual srs_error_t write(char* data, int size) = 0; virtual srs_error_t write(char* data, int size) = 0;
// for the HTTP FLV, to writev to improve performance. // for the HTTP FLV, to writev to improve performance.
// @see https://github.com/ossrs/srs/issues/405
virtual srs_error_t writev(const iovec* iov, int iovcnt, ssize_t* pnwrite) = 0; virtual srs_error_t writev(const iovec* iov, int iovcnt, ssize_t* pnwrite) = 0;
// WriteHeader sends an HTTP request header with status code. // WriteHeader sends an HTTP request header with status code.

View file

@ -799,7 +799,6 @@ srs_error_t SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg)
SrsChunkStream* chunk = NULL; SrsChunkStream* chunk = NULL;
// use chunk stream cache to get the chunk info. // use chunk stream cache to get the chunk info.
// @see https://github.com/ossrs/srs/issues/249
if (cid < SRS_PERF_CHUNK_STREAM_CACHE) { if (cid < SRS_PERF_CHUNK_STREAM_CACHE) {
// already init, use it direclty // already init, use it direclty
chunk = cs_cache[cid]; chunk = cs_cache[cid];
@ -2469,7 +2468,6 @@ srs_error_t SrsRtmpServer::identify_client(int stream_id, SrsRtmpConnType& type,
// call msg, // call msg,
// support response null first, // support response null first,
// @see https://github.com/ossrs/srs/issues/106
// TODO: FIXME: response in right way, or forward in edge mode. // TODO: FIXME: response in right way, or forward in edge mode.
SrsCallPacket* call = dynamic_cast<SrsCallPacket*>(pkt); SrsCallPacket* call = dynamic_cast<SrsCallPacket*>(pkt);
if (call) { if (call) {

View file

@ -56,7 +56,6 @@ private:
#endif #endif
// the user-space buffer to fill by reader, // the user-space buffer to fill by reader,
// which use fast index and reset when chunk body read ok. // which use fast index and reset when chunk body read ok.
// @see https://github.com/ossrs/srs/issues/248
// ptr to the current read position. // ptr to the current read position.
char* p; char* p;
// ptr to the content end. // ptr to the content end.