ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.

Home Page:https://ossrs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When the same client is streaming, the client_id for on_dvr callback is different from the other callbacks.

opened this issue · comments

The client_id for on_dvr callback is different from other callbacks when streaming with srs2.

TRANS_BY_GPT3

Can you provide more information? I didn't understand much.

TRANS_BY_GPT3

srs2 http_hook http回调我的程序的时候,同一个客户端的情况下 on_connect on_publish 等 传过来的client_id的值都是一样的 只有 on_dvr 传过来的client_id 和其他几个 callback不一样

Oh, I understand now. It's because the DVR is an asynchronous request that cannot be blocked, while the others are synchronous requests. Asynchronous requests are all opened in new threads, which causes the IDs to be different. This can be considered a bug.

TRANS_BY_GPT3



[2015-09-14 13:40:55][trace] post to clients, req={"action":"on_connect","client_id":107,"ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","tcUrl":"rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__","pageUrl":""}
[2015-09-14 13:40:55][trace] srs on_connect: client id=107, ip=127.0.0.1, vhost=__defaultVhost__, app=live, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=
127.0.0.1 - - [14/Sep/2015:13:40:55] "POST /api/v1/clients HTTP/1.1" 200 1 "" "SRS(Simple RTMP Server)2.0.187"
[2015-09-14 13:40:55][trace] post to clients, req={"action":"on_connect","client_id":107,"ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","tcUrl":"rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__","pageUrl":""}
[2015-09-14 13:40:55][trace] srs on_connect: client id=107, ip=127.0.0.1, vhost=__defaultVhost__, app=live, tcUrl=rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__, pageUrl=
127.0.0.1 - - [14/Sep/2015:13:40:55] "POST /api/v1/clients HTTP/1.1" 200 1 "" "SRS(Simple RTMP Server)2.0.187"
[2015-09-14 13:41:00][trace] post to dvrs, req={"action":"on_dvr","client_id":107,"ip":"127.0.0.1","vhost":"__defaultVhost__","app":"live","stream":"livestream","cwd":"/Users/winlin/Desktop/git/simple-rtmp-server/trunk","file":"./objs/nginx/html/live/livestream.1442209255227.flv"}
[2015-09-14 13:41:00][trace] srs on_dvr: client id=107, ip=127.0.0.1, vhost=__defaultVhost__, app=live, stream=livestream, cwd=/Users/winlin/Desktop/git/simple-rtmp-server/trunk, file=./objs/nginx/html/live/livestream.1442209255227.flv

Already fixed.

TRANS_BY_GPT3

on_dvr
on_hls
on_hls_notify
These three async hooks have all updated the cid.

TRANS_BY_GPT3

牛逼

commented

awesome

TRANS_BY_GPT3