Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 041417aed15ae67ce2c58993ee0410399e9278dc 1 parent e7d482f
Peteris Krumins authored July 07, 2010

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. 9  video.cc
9  video.cc
@@ -83,13 +83,14 @@ class VideoEncoder {
83 83
     ogg_page og;
84 84
     ogg_stream_state *ogg_os;
85 85
 
86  
-    bool hadFrame;
  86
+    unsigned long frameCount;
87 87
 
88 88
 public:
89 89
     VideoEncoder(int wwidth, int hheight) :
90 90
         width(wwidth), height(hheight), quality(31), frameRate(25),
91 91
         keyFrameInterval(64),
92  
-        hadFrame(false), ogg_fp(NULL), td(NULL), ogg_os(NULL) {}
  92
+        ogg_fp(NULL), td(NULL), ogg_os(NULL),
  93
+        frameCount(0) {}
93 94
 
94 95
     ~VideoEncoder() { end(); }
95 96
 
@@ -99,7 +100,7 @@ class VideoEncoder {
99 100
         HandleScope scope;
100 101
         Handle<Value> ret;
101 102
 
102  
-        if (!hadFrame) {
  103
+        if (!frameCount) {
103 104
             if (outputFileName.empty())
104 105
                 return VException("No output means was set. Use setOutputFile to set it.");
105 106
 
@@ -119,7 +120,7 @@ class VideoEncoder {
119 120
         }
120 121
         ret = WriteFrame(data);
121 122
         if (!ret->IsUndefined()) return ret;
122  
-        hadFrame = true;
  123
+        frameCount++;
123 124
 
124 125
         return Undefined();
125 126
     }

0 notes on commit 041417a

Please sign in to comment.
Something went wrong with that request. Please try again.