正在显示
3 个修改的文件
包含
5 行增加
和
1 行删除
| @@ -36,7 +36,8 @@ FMS URL: rtmp://127.0.0.1:1935/live | @@ -36,7 +36,8 @@ FMS URL: rtmp://127.0.0.1:1935/live | ||
| 36 | Stream: livestream | 36 | Stream: livestream |
| 37 | For example, use ffmpeg to publish: | 37 | For example, use ffmpeg to publish: |
| 38 | for((;;)); do \ | 38 | for((;;)); do \ |
| 39 | - ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv -vcodec copy -acodec copy \ | 39 | + ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \ |
| 40 | + -vcodec copy -acodec copy \ | ||
| 40 | -f flv -y rtmp://127.0.0.1:1935/live/livestream; \ | 41 | -f flv -y rtmp://127.0.0.1:1935/live/livestream; \ |
| 41 | sleep 1; \ | 42 | sleep 1; \ |
| 42 | done | 43 | done |
trunk/src/core/srs_core_encoder.cpp
100644 → 100755
| @@ -109,6 +109,7 @@ int SrsFFMPEG::initialize(std::string vhost, std::string port, std::string app, | @@ -109,6 +109,7 @@ int SrsFFMPEG::initialize(std::string vhost, std::string port, std::string app, | ||
| 109 | if (output.length() > input.length()) { | 109 | if (output.length() > input.length()) { |
| 110 | tail = output.substr(input.length()); | 110 | tail = output.substr(input.length()); |
| 111 | } | 111 | } |
| 112 | + // TODO: better dead loop check. | ||
| 112 | // if input also endwiths the tail, loop detected. | 113 | // if input also endwiths the tail, loop detected. |
| 113 | if (!tail.empty() && input.rfind(tail) == input.length() - tail.length()) { | 114 | if (!tail.empty() && input.rfind(tail) == input.length() - tail.length()) { |
| 114 | ret = ERROR_ENCODER_LOOP; | 115 | ret = ERROR_ENCODER_LOOP; |
trunk/src/core/srs_core_forward.cpp
100644 → 100755
| @@ -77,6 +77,8 @@ int SrsForwarder::on_publish(std::string vhost, std::string _app, std::string st | @@ -77,6 +77,8 @@ int SrsForwarder::on_publish(std::string vhost, std::string _app, std::string st | ||
| 77 | server = forward_server; | 77 | server = forward_server; |
| 78 | port = 1935; | 78 | port = 1935; |
| 79 | 79 | ||
| 80 | + // TODO: dead loop check. | ||
| 81 | + | ||
| 80 | size_t pos = forward_server.find(":"); | 82 | size_t pos = forward_server.find(":"); |
| 81 | if (pos != std::string::npos) { | 83 | if (pos != std::string::npos) { |
| 82 | port = ::atoi(forward_server.substr(pos + 1).c_str()); | 84 | port = ::atoi(forward_server.substr(pos + 1).c_str()); |
-
请 注册 或 登录 后发表评论