1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

disable gop cache when not h.264. fix some warning.

This commit is contained in:
winlin 2014-12-01 21:34:35 +08:00
parent c5dd334645
commit d171a26758
7 changed files with 14 additions and 7 deletions

View file

@ -95,7 +95,7 @@ int main(int argc, char** argv)
// open file
int raw_fd = open(raw_file, O_RDONLY);
if (raw_fd < 0) {
srs_human_trace("open audio raw file %s failed.", raw_fd);
srs_human_trace("open audio raw file %s failed.", raw_file);
goto rtmp_destroy;
}

View file

@ -47,7 +47,7 @@ int read_audio_frame(char* audio_raw, int file_size, char** pp, char** pdata, in
if (file_size - (p - audio_raw) < 168) {
srs_human_trace("audio must be 160+8 bytes. left %d bytes.",
file_size - (p - audio_raw));
(int)(file_size - (p - audio_raw)));
return - 1;
}
@ -88,7 +88,7 @@ int main(int argc, char** argv)
// open file
int raw_fd = open(raw_file, O_RDONLY);
if (raw_fd < 0) {
srs_human_trace("open audio raw file %s failed.", raw_fd);
srs_human_trace("open audio raw file %s failed.", raw_file);
goto rtmp_destroy;
}

View file

@ -132,6 +132,7 @@ rtmp_destroy:
"\"srs_id\":%d, "
"\"duration\":%d, "
"\"play_duration\":%d, "
"\"publish_duration\":%d,"
"\"play_kbps\":%d, "
"\"publish_kbps\":%d"
"}",

View file

@ -100,7 +100,7 @@ int main(int argc, char** argv)
// open file
int raw_fd = open(raw_file, O_RDONLY);
if (raw_fd < 0) {
srs_human_trace("open h264 raw file %s failed.", raw_fd);
srs_human_trace("open h264 raw file %s failed.", raw_file);
goto rtmp_destroy;
}

View file

@ -393,6 +393,12 @@ int SrsGopCache::cache(SrsSharedPtrMessage* msg)
return ret;
}
// disable gop cache when not h.264
if (!SrsFlvCodec::video_is_h264(msg->payload, msg->size)) {
srs_info("gop donot cache video for none h.264");
return ret;
}
// got video, update the video count if acceptable
if (msg->header.is_video()) {
cached_video_count++;

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.1, 2014-11-30T15:48:20. -->
<!-- Written by QtCreator 3.1.1, 2014-12-01T21:33:00. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>