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

@ -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: