harlanc / xiu

A simple,high performance and secure live media server in pure Rust (RTMP[cluster]/RTSP/WebRTC[whip/whep]/HTTP-FLV/HLS).🦀
https://www.rustxiu.com
MIT License
1.61k stars 168 forks source link

当 rtmp 流不存在时,httpflv 仍会尝试从流中获取数据 #77

Closed ningnao closed 6 months ago

ningnao commented 7 months ago

XIU version master(5ce3bc2c9751a63f79f1ab3568f6c2079f06fd4a)

Describe the bug 当 rtmp 流不存在时,httpflv 仍会尝试从流中获取数据

    pub async fn run(&mut self) -> Result<(), HttpFLvError> {
        self.subscribe_from_rtmp_channels().await?;
        self.send_media_stream().await?;

        Ok(())
    }

预期在self.subscribe_from_rtmp_channels().await?;结束后,若 rtmp 端流不存在,则报错返回,实际上仍然执行了接下来的方法

做了个试验,self.subscribe_from_rtmp_channels().await?;执行完毕后,并没有立刻出现no app or stream name error,同时,进入方法内,rv.is_err()似乎总是false,即使流不存在