mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #124, gop cache support disable video in publishing. 0.9.171.
This commit is contained in:
parent
50cd1d2360
commit
b17c736f3f
4 changed files with 34 additions and 2 deletions
|
@ -213,6 +213,19 @@ private:
|
|||
*/
|
||||
int cached_video_count;
|
||||
/**
|
||||
* when user disabled video when publishing, and gop cache enalbed,
|
||||
* we will cache the audio/video for we already got video, but we never
|
||||
* know when to clear the gop cache, for there is no video in future,
|
||||
* so we must guess whether user disabled the video.
|
||||
* when we got some audios after laster video, for instance, 600 audio packets,
|
||||
* about 3s(26ms per packet) 115 audio packets, clear gop cache.
|
||||
*
|
||||
* @remark, it is ok for performance, for when we clear the gop cache,
|
||||
* gop cache is disabled for pure audio stream.
|
||||
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/124
|
||||
*/
|
||||
int audio_count_after_last_video;
|
||||
/**
|
||||
* cached gop.
|
||||
*/
|
||||
std::vector<SrsSharedPtrMessage*> gop_cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue