Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-04-22 17:50:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
435e02db5de01ea4f931fbc6857a639ca55dcb51
435e02db
1 parent
733ca247
dvr use .tmp and rename to .flv when finished.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
23 行增加
和
2 行删除
trunk/src/app/srs_app_dvr.cpp
trunk/src/app/srs_app_dvr.hpp
trunk/src/kernel/srs_kernel_error.hpp
trunk/src/app/srs_app_dvr.cpp
查看文件 @
435e02d
...
...
@@ -454,7 +454,9 @@ int SrsDvrPlan::flv_open(string stream, string path)
{
int
ret
=
ERROR_SUCCESS
;
if
((
ret
=
fs
->
open
(
path
))
!=
ERROR_SUCCESS
)
{
current_flv_path
=
path
;
std
::
string
tmp_file
=
path
+
".tmp"
;
if
((
ret
=
fs
->
open
(
tmp_file
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"open file stream for file %s failed. ret=%d"
,
path
.
c_str
(),
ret
);
return
ret
;
}
...
...
@@ -487,7 +489,21 @@ int SrsDvrPlan::on_video_msg(SrsSharedPtrMessage* /*video*/)
int
SrsDvrPlan
::
flv_close
()
{
return
fs
->
close
();
int
ret
=
ERROR_SUCCESS
;
if
((
ret
=
fs
->
close
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
std
::
string
tmp_file
=
current_flv_path
+
".tmp"
;
if
(
rename
(
tmp_file
.
c_str
(),
current_flv_path
.
c_str
())
<
0
)
{
ret
=
ERROR_SYSTEM_FILE_RENAME
;
srs_error
(
"rename flv file failed, %s => %s. ret=%d"
,
tmp_file
.
c_str
(),
current_flv_path
.
c_str
(),
ret
);
return
ret
;
}
return
ret
;
}
int
SrsDvrPlan
::
on_dvr_keyframe
()
...
...
trunk/src/app/srs_app_dvr.hpp
查看文件 @
435e02d
...
...
@@ -127,6 +127,10 @@ protected:
SrsSource
*
_source
;
SrsRequest
*
_req
;
SrsRtmpJitter
*
jitter
;
/**
* current flv file path.
*/
std
::
string
current_flv_path
;
public
:
SrsDvrPlan
();
virtual
~
SrsDvrPlan
();
...
...
trunk/src/kernel/srs_kernel_error.hpp
查看文件 @
435e02d
...
...
@@ -106,6 +106,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define ERROR_SYSTEM_FILE_READ 426
#define ERROR_SYSTEM_FILE_WRITE 427
#define ERROR_SYSTEM_FILE_EOF 428
#define ERROR_SYSTEM_FILE_RENAME 429
// see librtmp.
// failed when open ssl create the dh
...
...
请
注册
或
登录
后发表评论