Skip to content

Commit

Permalink
1 fix hevc dvr cannot record problem
Browse files Browse the repository at this point in the history
2 fix srs_dvr.py exception in some case
  • Loading branch information
wnpllrzodiac committed Jan 29, 2018
1 parent 0a8efd7 commit 9953fe5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion trunk/research/api-server/srs_dvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def dvr_copy():
if os.path.exists(last_dvr_folder):
check_folder(last_dvr_folder, None)

check_folder(dvr_folder, now)
if os.path.exists(dvr_folder):
check_folder(dvr_folder, now)

last_dvr_folders[stream['name']] = dvr_folder

Expand Down
4 changes: 2 additions & 2 deletions trunk/src/app/srs_app_dvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ int SrsFlvSegment::write_video(SrsSharedPtrMessage* shared_video)

bool is_sequence_header = SrsFlvCodec::video_is_sequence_header(payload, size);
#ifdef SRS_AUTO_HTTP_CALLBACK
bool is_key_frame = SrsFlvCodec::video_is_h264(payload, size)
bool is_key_frame = (SrsFlvCodec::video_is_h264(payload, size) || SrsFlvCodec::video_is_hevc(payload, size))
&& SrsFlvCodec::video_is_keyframe(payload, size) && !is_sequence_header;
if (is_key_frame) {
has_keyframe = true;
Expand Down Expand Up @@ -950,7 +950,7 @@ int SrsDvrSegmentPlan::update_duration(SrsSharedPtrMessage* msg)

char* payload = msg->payload;
int size = msg->size;
bool is_key_frame = SrsFlvCodec::video_is_h264(payload, size)
bool is_key_frame = (SrsFlvCodec::video_is_h264(payload, size) || SrsFlvCodec::video_is_hevc(payload, size))
&& SrsFlvCodec::video_is_keyframe(payload, size)
&& !SrsFlvCodec::video_is_sequence_header(payload, size);
if (!is_key_frame) {
Expand Down

0 comments on commit 9953fe5

Please sign in to comment.