Skip to content

Commit

Permalink
1.0 stabilization (#235)
Browse files Browse the repository at this point in the history
- SIGSEGV crash
- add datetime to ffmpeg log prints

* - stabilization
  • Loading branch information
igorshevach authored Aug 15, 2016
1 parent 144ad10 commit 78075bb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
Binary file modified bin/darwin/FormatConverter.node
Binary file not shown.
Binary file modified bin/darwin/FormatConverter.node.debug
Binary file not shown.
Binary file modified bin/linux/FormatConverter.node
Binary file not shown.
Binary file modified bin/linux/FormatConverter.node.debug
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/playlistGenerator/MixFilterClip.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ var validateInput = function(fileInfo){
that.logger.warn('FileInfo.video.duration <= 0');
return false;
}
if (!fileInfo.video.keyFrameDTS || !fileInfo.video.keyFrameDTS.length) {
that.logger.warn('FileInfo.video track has no key frames');
}
}

if(fileInfo.audio) {
Expand Down
25 changes: 20 additions & 5 deletions node_addons/FormatConverter/src/Converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "Converter.h"
#include <bitset>
#include <set>
#include <chrono>

extern "C"{
#include <libavformat/movenc.h>

Expand Down Expand Up @@ -117,14 +119,24 @@ namespace converter{
return 0;
}

const char szDateTimeormat [] = "%F %T %z";
void ConverterAppInst::avlog_cb(void *data, int level, const char * szFmt, va_list varg){
if(level > av_log_get_level()){
return;
}
if(!ConverterAppInst::instance().m_filter.filter(szFmt)){
return;
}
av_log_default_callback(data,level,szFmt,varg);
//include date-time
std::time_t t = std::time(nullptr);
std::gmtime(&t);
std::tm *tm = std::gmtime(&t);
char szDateTime[sizeof("2016-08-15 08:45:07 +0200\0")];

std::strftime(szDateTime,sizeof(szDateTime),szDateTimeormat,tm);
std::string formatDateTime(szDateTime);
formatDateTime += std::string(" ") + szFmt;
av_log_default_callback(data,level,formatDateTime.c_str(),varg);
}


Expand Down Expand Up @@ -403,10 +415,13 @@ namespace converter{
break;
}
}

auto diff = result[0];

std::transform(result.begin(),result.end(),result.begin(),[ diff ] (double val) -> double { return val - diff; });

if(result.size()){

auto diff = result[0];

std::transform(result.begin(),result.end(),result.begin(),[ diff ] (double val) -> double { return val - diff; });
}

return 0;
}
Expand Down

0 comments on commit 78075bb

Please sign in to comment.