From 69cc01b696c64e6b99dda3918993f4d0b8bd6d56 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 13 Oct 2015 16:54:51 +0800 Subject: [PATCH] use system utilities --- trunk/src/app/srs_app_dvr.cpp | 2 +- trunk/src/app/srs_app_ffmpeg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trunk/src/app/srs_app_dvr.cpp b/trunk/src/app/srs_app_dvr.cpp index a15974098..4f161208f 100644 --- a/trunk/src/app/srs_app_dvr.cpp +++ b/trunk/src/app/srs_app_dvr.cpp @@ -410,7 +410,7 @@ string SrsFlvSegment::generate_path() std::string path_config = _srs_config->get_dvr_path(req->vhost); // add [stream].[timestamp].flv as filename for dir - if (path_config.find(".flv") != path_config.length() - 4) { + if (!srs_string_ends_with(path_config, ".flv")) { path_config += "/[stream].[timestamp].flv"; } diff --git a/trunk/src/app/srs_app_ffmpeg.cpp b/trunk/src/app/srs_app_ffmpeg.cpp index cb28f0479..79f262916 100644 --- a/trunk/src/app/srs_app_ffmpeg.cpp +++ b/trunk/src/app/srs_app_ffmpeg.cpp @@ -219,7 +219,7 @@ int SrsFFMPEG::initialize_transcode(SrsConfDirective* engine) // for not rtmp input, donot append the iformat, // for example, "-f flv" before "-i udp://192.168.1.252:2222" // @see https://github.com/simple-rtmp-server/srs/issues/290 - if (input.find("rtmp://") != 0) { + if (!srs_string_starts_with(input, "rtmp://")) { iformat = ""; }