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-17 16:08:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
271b969d0b09929416c8c891eeb09363cebb8b65
271b969d
1 parent
73459547
set audio/video flag to 0 in flv header.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
3 行增加
和
20 行删除
trunk/src/app/srs_app_dvr.cpp
trunk/src/app/srs_app_dvr.hpp
trunk/src/app/srs_app_dvr.cpp
查看文件 @
271b969
...
...
@@ -143,8 +143,6 @@ off_t SrsFileStream::lseek(off_t offset)
SrsFlvEncoder
::
SrsFlvEncoder
()
{
_fs
=
NULL
;
has_audio
=
false
;
has_video
=
false
;
tag_stream
=
new
SrsStream
();
}
...
...
@@ -158,8 +156,6 @@ int SrsFlvEncoder::initialize(SrsFileStream* fs)
int
ret
=
ERROR_SUCCESS
;
_fs
=
fs
;
has_audio
=
true
;
has_video
=
true
;
return
ret
;
}
...
...
@@ -179,16 +175,9 @@ int SrsFlvEncoder::write_header()
(
char
)
0x00
,
(
char
)
0x00
,
(
char
)
0x00
,
(
char
)
0x00
// PreviousTagSize0 UI32 Always 0
};
// generate audio/video flag.
const
static
int
av_index
=
4
;
flv_header
[
av_index
]
=
0x00
;
if
(
has_audio
)
{
flv_header
[
av_index
]
+=
4
;
}
if
(
has_video
)
{
flv_header
[
av_index
]
+=
1
;
}
// flv specification should set the audio and video flag,
// actually in practise, application generally ignore this flag,
// so we generally set the audio/video to 0.
// write data.
if
((
ret
=
_fs
->
write
(
flv_header
,
sizeof
(
flv_header
),
NULL
))
!=
ERROR_SUCCESS
)
{
...
...
@@ -229,8 +218,6 @@ int SrsFlvEncoder::write_audio(int32_t timestamp, char* data, int size)
{
int
ret
=
ERROR_SUCCESS
;
has_audio
=
true
;
static
char
tag_header
[]
=
{
(
char
)
8
,
// TagType UB [5], 8 = audio
(
char
)
0x00
,
(
char
)
0x00
,
(
char
)
0x00
,
// DataSize UI24 Length of the message.
...
...
@@ -260,8 +247,6 @@ int SrsFlvEncoder::write_video(int32_t timestamp, char* data, int size)
{
int
ret
=
ERROR_SUCCESS
;
has_video
=
true
;
static
char
tag_header
[]
=
{
(
char
)
9
,
// TagType UB [5], 9 = video
(
char
)
0x00
,
(
char
)
0x00
,
(
char
)
0x00
,
// DataSize UI24 Length of the message.
...
...
trunk/src/app/srs_app_dvr.hpp
查看文件 @
271b969
...
...
@@ -79,8 +79,6 @@ class SrsFlvEncoder
private
:
SrsFileStream
*
_fs
;
private
:
bool
has_audio
;
bool
has_video
;
SrsStream
*
tag_stream
;
public
:
SrsFlvEncoder
();
...
...
请
注册
或
登录
后发表评论