Permalink
Browse files

use frameCount instead of hadFrame. frameCount will be used to do VFR

  • Loading branch information...
1 parent e7d482f commit 041417aed15ae67ce2c58993ee0410399e9278dc @pkrumins committed Jul 7, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 video.cc
View
9 video.cc
@@ -83,13 +83,14 @@ class VideoEncoder {
ogg_page og;
ogg_stream_state *ogg_os;
- bool hadFrame;
+ unsigned long frameCount;
public:
VideoEncoder(int wwidth, int hheight) :
width(wwidth), height(hheight), quality(31), frameRate(25),
keyFrameInterval(64),
- hadFrame(false), ogg_fp(NULL), td(NULL), ogg_os(NULL) {}
+ ogg_fp(NULL), td(NULL), ogg_os(NULL),
+ frameCount(0) {}
~VideoEncoder() { end(); }
@@ -99,7 +100,7 @@ class VideoEncoder {
HandleScope scope;
Handle<Value> ret;
- if (!hadFrame) {
+ if (!frameCount) {
if (outputFileName.empty())
return VException("No output means was set. Use setOutputFile to set it.");
@@ -119,7 +120,7 @@ class VideoEncoder {
}
ret = WriteFrame(data);
if (!ret->IsUndefined()) return ret;
- hadFrame = true;
+ frameCount++;
return Undefined();
}

0 comments on commit 041417a

Please sign in to comment.