srs icon indicating copy to clipboard operation
srs copied to clipboard

Config: Failed to parse config ending with newline.

Open Nibbler999 opened this issue 4 years ago • 3 comments

Description'

Please ensure that the markdown structure is maintained.

Documentation for realtime config has an error

  1. SRS version: 3.0.153
  2. The log of SRS is as follows:'

Please ensure that the markdown structure is maintained.

start play smi=0ms, mw_sleep=100, mw_enabled=1, realtime=0, tcp_nodelay=1
  1. The configuration of SRS is as follows:

Please ensure that the markdown structure is maintained.

# the listen ports, split by space.
listen              1935;
vhost __defaultVhost__ {
    tcp_nodelay     on
    min_latency     on;

    play {
        gop_cache       off;
        queue_length    10;
        mw_latency      100;
    }

    publish {
        mr off;
    }
}

Replay

Please ensure that the markdown structure is maintained.

Play stream with rtmp client and check log

Expect

Please ensure that the markdown structure is maintained.

realtime=1

If I add the missing semi-colon to the config after tcp_nodelay on then the min_latency setting is applied correctly. The sample configuration is incorrect in both conf/realtime.conf and the wiki in both languages.

TRANS_BY_GPT3

Nibbler999 avatar Mar 06 '21 11:03 Nibbler999

It seems a bug.

winlinvip avatar Jun 16 '21 23:06 winlinvip

It's bug for config to parsing the config directive, should be error when ends with '\n' without ';'

Postpone to 5.0

winlinvip avatar Dec 26 '21 08:12 winlinvip

Each config directive should end with ; or semi-colon. We should not only fix this bug, but also cover by utest. This means bellow testcase should fail, as tcp_nodelay on is missing a semicolon:

    tcp_nodelay     on
    min_latency     on;

winlinvip avatar Apr 23 '24 23:04 winlinvip