winlin

fix #302, remove the thread unsafe code, no static.

... ... @@ -146,7 +146,7 @@ public:
data.append(serialFlv(msg));
}
static char box_header[8];
char box_header[8];
SrsStream ss;
ss.initialize(box_header, 8);
ss.write_4bytes(8 + data.size());
... ...
... ... @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 146
#define VERSION_REVISION 147
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
... ...
... ... @@ -74,7 +74,7 @@ int SrsFlvEncoder::write_header()
int ret = ERROR_SUCCESS;
// 9bytes header and 4bytes first previous-tag-size
static char flv_header[] = {
char flv_header[] = {
'F', 'L', 'V', // Signatures "FLV"
(char)0x01, // File version (for example, 0x01 for FLV version 1)
(char)0x00, // 4, audio; 1, video; 5 audio+video.
... ... @@ -118,7 +118,7 @@ int SrsFlvEncoder::write_metadata(char type, char* data, int size)
srs_assert(data);
// 11 bytes tag header
static char tag_header[] = {
char tag_header[] = {
(char)type, // TagType UB [5], 18 = script data
(char)0x00, (char)0x00, (char)0x00, // DataSize UI24 Length of the message.
(char)0x00, (char)0x00, (char)0x00, // Timestamp UI24 Time in milliseconds at which the data in this tag applies.
... ... @@ -149,7 +149,7 @@ int SrsFlvEncoder::write_audio(int64_t timestamp, char* data, int size)
timestamp &= 0x7fffffff;
// 11bytes tag header
static char tag_header[] = {
char tag_header[] = {
(char)SrsCodecFlvTagAudio, // TagType UB [5], 8 = audio
(char)0x00, (char)0x00, (char)0x00, // DataSize UI24 Length of the message.
(char)0x00, (char)0x00, (char)0x00, // Timestamp UI24 Time in milliseconds at which the data in this tag applies.
... ... @@ -183,7 +183,7 @@ int SrsFlvEncoder::write_video(int64_t timestamp, char* data, int size)
timestamp &= 0x7fffffff;
// 11bytes tag header
static char tag_header[] = {
char tag_header[] = {
(char)SrsCodecFlvTagVideo, // TagType UB [5], 9 = video
(char)0x00, (char)0x00, (char)0x00, // DataSize UI24 Length of the message.
(char)0x00, (char)0x00, (char)0x00, // Timestamp UI24 Time in milliseconds at which the data in this tag applies.
... ... @@ -231,7 +231,7 @@ int SrsFlvEncoder::write_tag(char* header, int header_size, char* tag, int tag_s
}
// PreviousTagSizeN UI32 Size of last tag, including its header, in bytes.
static char pre_size[SRS_FLV_PREVIOUS_TAG_SIZE];
char pre_size[SRS_FLV_PREVIOUS_TAG_SIZE];
if ((ret = tag_stream->initialize(pre_size, SRS_FLV_PREVIOUS_TAG_SIZE)) != ERROR_SUCCESS) {
return ret;
}
... ... @@ -426,7 +426,7 @@ int SrsFlvVodStreamDecoder::read_sequence_header_summary(int64_t* pstart, int* p
// and must be a sequence video and audio.
// 11bytes tag header
static char tag_header[] = {
char tag_header[] = {
(char)0x00, // TagType UB [5], 9 = video, 8 = audio, 18 = script data
(char)0x00, (char)0x00, (char)0x00, // DataSize UI24 Length of the message.
(char)0x00, (char)0x00, (char)0x00, // Timestamp UI24 Time in milliseconds at which the data in this tag applies.
... ...
... ... @@ -68,7 +68,7 @@ int SrsMp3Encoder::initialize(SrsFileWriter* fs)
int SrsMp3Encoder::write_header()
{
static char id3[] = {
char id3[] = {
(char)0x49, (char)0x44, (char)0x33, // ID3
(char)0x03, (char)0x00, // version
(char)0x00, // flags
... ...
... ... @@ -2772,7 +2772,7 @@ int SrsTsCache::do_cache_aac(SrsAvcAacCodec* codec, SrsCodecSample* sample)
// 6.2 Audio Data Transport Stream, ADTS
// in aac-iso-13818-7.pdf, page 26.
// fixed 7bytes header
static u_int8_t adts_header[7] = {0xff, 0xf9, 0x00, 0x00, 0x00, 0x0f, 0xfc};
u_int8_t adts_header[7] = {0xff, 0xf9, 0x00, 0x00, 0x00, 0x0f, 0xfc};
/*
// adts_fixed_header
// 2B, 16bits
... ... @@ -2824,7 +2824,7 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample)
int ret = ERROR_SUCCESS;
// for type1/5/6, insert aud packet.
static u_int8_t aud_nal[] = { 0x00, 0x00, 0x00, 0x01, 0x09, 0xf0 };
u_int8_t aud_nal[] = { 0x00, 0x00, 0x00, 0x01, 0x09, 0xf0 };
bool sps_pps_sent = false;
bool aud_sent = false;
... ...
... ... @@ -2340,7 +2340,7 @@ int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* data, int
const char* srs_human_format_time()
{
struct timeval tv;
static char buf[23];
char buf[23];
memset(buf, 0, sizeof(buf));
... ...
... ... @@ -260,7 +260,7 @@ int SrsHandshakeBytes::create_c0c1()
srs_random_generate(c0c1, 1537);
// plain text required.
static SrsStream stream;
SrsStream stream;
if ((ret = stream.initialize(c0c1, 9)) != ERROR_SUCCESS) {
return ret;
}
... ...