Commit 269e2c0
fix(rtsp): fully drain TCP interleaved socket for edge-triggered pollers
Two edge-triggered (EPOLLET) bugs caused RTSP playback to receive only
a small burst of data before stalling:
1. rtsp_handle_tcp_interleaved_data() returned after filling and
processing the 4096-byte response buffer once, without looping back
to recv() remaining socket data. With level-triggered this was fine
(EPOLLIN re-fires immediately), but edge-triggered requires draining
until EAGAIN. Fix: add an outer loop that repeats recv+process until
EAGAIN or the buffer is stuck full.
2. After the PLAY response transitioned state to PLAYING, the code
returned from the awaiting_response branch without falling through to
the PLAYING handler. Preserved RTP data in the response buffer and
any unread socket data were left unprocessed until the next edge.
Fix: fall through to rtsp_handle_tcp_interleaved_data() when state
becomes PLAYING.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 423f77f commit 269e2c0
1 file changed
Lines changed: 51 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1053 | 1053 | | |
1054 | 1054 | | |
1055 | 1055 | | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1056 | 1065 | | |
1057 | | - | |
1058 | 1066 | | |
1059 | 1067 | | |
1060 | 1068 | | |
| |||
1882 | 1890 | | |
1883 | 1891 | | |
1884 | 1892 | | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
1889 | | - | |
1890 | | - | |
1891 | | - | |
1892 | | - | |
1893 | | - | |
1894 | | - | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
1895 | 1918 | | |
1896 | | - | |
1897 | | - | |
1898 | | - | |
1899 | | - | |
1900 | | - | |
| 1919 | + | |
| 1920 | + | |
1901 | 1921 | | |
1902 | 1922 | | |
1903 | | - | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
1904 | 1937 | | |
1905 | 1938 | | |
1906 | | - | |
| 1939 | + | |
1907 | 1940 | | |
1908 | 1941 | | |
1909 | 1942 | | |
| |||
0 commit comments