1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +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.
// @see https://github.com/ossrs/srs/issues/177
if (wait_keyframe) {
if (!msg->is_video()) {
return err;

View file

@ -201,7 +201,6 @@ srs_error_t SrsEdgeFlvUpstream::do_connect(SrsRequest* r, SrsLbRoundRobin* lb, i
if (redirect_depth == 0) {
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,
// then user remove the vhost then reload, the conf is empty.
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 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://")) {
iformat = "";
}

View file

@ -554,7 +554,6 @@ bool SrsHlsMuxer::wait_keyframe()
bool SrsHlsMuxer::is_segment_absolutely_overflow()
{
// @see https://github.com/ossrs/srs/issues/151#issuecomment-83553950
srs_assert(current);
// 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
* typical target duration is 10 seconds.
*/
// @see https://github.com/ossrs/srs/issues/304#issuecomment-74000081
srs_utime_t max_duration = segments->max_duration();
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,
// pure audio again for audio disabled.
// 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
// @see https://github.com/ossrs/srs/issues/151#issuecomment-71155184
if (tsmc->audio && muxer->is_segment_absolutely_overflow()) {
if ((err = reap_segment()) != srs_success) {
return srs_error_wrap(err, "hls: reap segment");

View file

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

View file

@ -1020,7 +1020,6 @@ srs_error_t SrsRtmpConn::do_publishing(SrsLiveSource* source, SrsPublishRecvThre
// cond wait for timeout.
if (nb_msgs == 0) {
// when not got msgs, wait for a larger timeout.
// @see https://github.com/ossrs/srs/issues/441
rtrd->wait(publish_1stpkt_timeout);
} else {
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) {
// 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);
if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) {
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) {
// TODO: We should support more strategies.
// 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);
if (srs_config_hls_is_on_error_ignore(hls_error_strategy)) {
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 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 (ds && audio && (err = consumer->enqueue(audio, atc, ag)) != srs_success) {
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.
// @see https://github.com/ossrs/srs/issues/713
// @see https://github.com/ossrs/srs/issues/714
#if 0
// When source expired, remove it.
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.
// @see ISO_IEC_14496-3-AAC-2001.pdf, page 75,
// 1.A.2.2 Audio_Data_Transport_Stream frame, ADTS
// @see https://github.com/ossrs/srs/issues/212#issuecomment-64145885
// byte_alignment()
// adts_fixed_header:

View file

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

View file

@ -1118,7 +1118,6 @@ int SrsIngestHlsOutput::write_h264_ipb_frame(string ibps, SrsVideoAvcFrameType f
srs_error_t err = srs_success;
// when sps or pps not sent, ignore the packet.
// @see https://github.com/ossrs/srs/issues/203
if (!h264_sps_pps_sent) {
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.
virtual srs_error_t write(char* data, int size) = 0;
// 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;
// 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.
virtual srs_error_t write(char* data, int size) = 0;
// 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;
// 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;
// use chunk stream cache to get the chunk info.
// @see https://github.com/ossrs/srs/issues/249
if (cid < SRS_PERF_CHUNK_STREAM_CACHE) {
// already init, use it direclty
chunk = cs_cache[cid];
@ -2469,7 +2468,6 @@ srs_error_t SrsRtmpServer::identify_client(int stream_id, SrsRtmpConnType& type,
// call msg,
// support response null first,
// @see https://github.com/ossrs/srs/issues/106
// TODO: FIXME: response in right way, or forward in edge mode.
SrsCallPacket* call = dynamic_cast<SrsCallPacket*>(pkt);
if (call) {

View file

@ -56,7 +56,6 @@ private:
#endif
// the user-space buffer to fill by reader,
// 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.
char* p;
// ptr to the content end.