Skip to content

【BUG】AudioConsumer 中 consume 方法是不是存在无法完整消费剩余数据的情况? #16

@othorizon

Description

@othorizon

if besent_packages > AudioConsumer.MIN_BUFFER_SIZE and data_len //self._bytes_per_frame < AudioConsumer.MIN_BUFFER_SIZE: #for fist time, if data_len is not enough, just return and wait for next time

在这个文件中

class AudioConsumer:
    def consume(self):
       //....something
        if besent_packages > AudioConsumer.MIN_BUFFER_SIZE and data_len //self._bytes_per_frame < AudioConsumer.MIN_BUFFER_SIZE: #for fist time, if data_len is not enough, just return and wait for next time
            #print("-----underflow data")
            return -2

这里虽然注释说只有第一次会触发,但是如果我推送结束后,不再有新的数据继续推送,但是剩余数据又不足一个发送包,并且没有 release 的情况下。这里会一直返回 -2 。也就是说在release 之前我无法通过is_push_to_rtc_completed 或者 len() 正确的判断是否发送完成。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions