Skip to content

Commit

Permalink
for bug #194, remove the poll, it's no-use
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Nov 12, 2014
1 parent bc1b5f4 commit a6f3478
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 148 deletions.
3 changes: 1 addition & 2 deletions trunk/configure
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,7 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
"srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config"
"srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_http_conn" "srs_app_http_hooks"
"srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge"
"srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac"
"srs_app_poll")
"srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client" "srs_app_avc_aac")
APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh
APP_OBJS="${MODULE_OBJS[@]}"
fi
Expand Down
57 changes: 0 additions & 57 deletions trunk/src/app/srs_app_poll.cpp

This file was deleted.

70 changes: 0 additions & 70 deletions trunk/src/app/srs_app_poll.hpp

This file was deleted.

23 changes: 7 additions & 16 deletions trunk/src/app/srs_app_rtmp_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ using namespace std;
#include <srs_app_utility.hpp>
#include <srs_protocol_msg_array.hpp>
#include <srs_protocol_amf0.hpp>
#include <srs_app_poll.hpp>

// when stream is busy, for example, streaming is already
// publishing, when a new client to request to publish,
Expand Down Expand Up @@ -517,16 +516,10 @@ int SrsRtmpConn::playing(SrsSource* source)
SrsAutoFree(SrsConsumer, consumer);
srs_verbose("consumer created success.");

// use poll fd to manage the connection, read when active.
SrsPoll poll_fd;
if ((ret = poll_fd.initialize(stfd)) != ERROR_SUCCESS) {
return ret;
}

// TODO: FIXME: remove following.
//rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
rtmp->set_recv_timeout(ST_UTIME_NO_TIMEOUT);
rtmp->set_send_timeout(ST_UTIME_NO_TIMEOUT);
rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
//rtmp->set_recv_timeout(ST_UTIME_NO_TIMEOUT);
//rtmp->set_send_timeout(ST_UTIME_NO_TIMEOUT);

// initialize other components
SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER);
Expand All @@ -539,9 +532,7 @@ int SrsRtmpConn::playing(SrsSource* source)
pithy_print.elapse();

// read from client.
if (poll_fd.active()) {
poll_fd.set_active(false);

if (true) {
SrsMessage* msg = NULL;
ret = rtmp->recv_message(&msg);
srs_verbose("play loop recv message. ret=%d", ret);
Expand Down Expand Up @@ -574,9 +565,9 @@ int SrsRtmpConn::playing(SrsSource* source)
// no data, sleep a while.
// for the poll_fd maybe not active, and no message.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/194
if (count <= 0) {
st_usleep(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
}
//if (count <= 0) {
// st_usleep(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
//}

// reportable
if (pithy_print.can_print()) {
Expand Down
1 change: 0 additions & 1 deletion trunk/src/kernel/srs_kernel_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define ERROR_EDGE_VHOST_REMOVED 3039
#define ERROR_HLS_AVC_TRY_OTHERS 3040
#define ERROR_H264_API_NO_PREFIXED 3041
#define ERROR_RTMP_POLL_FD_DUPLICATED 3042

/**
* whether the error code is an system control error.
Expand Down
2 changes: 0 additions & 2 deletions trunk/src/srs/srs.upp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ file
..\app\srs_app_kbps.cpp,
..\app\srs_app_log.hpp,
..\app\srs_app_log.cpp,
..\app\srs_app_poll.hpp,
..\app\srs_app_poll.cpp,
..\app\srs_app_refer.hpp,
..\app\srs_app_refer.cpp,
..\app\srs_app_reload.hpp,
Expand Down

0 comments on commit a6f3478

Please sign in to comment.