Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
Fix a few comments lacking periods, and misc things.

Signed-off-by: Derek Buitenhuis <[email protected]>
  • Loading branch information
dwbuiten committed Dec 9, 2012
1 parent c585ba6 commit 049ef05
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions core/d2v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ d2vcontext *d2vparse(char *filename, string& err)
ret->files = new string[ret->num_files];

/* Read them all in. */
for (i = 0; i < ret->num_files; i++) {
for(i = 0; i < ret->num_files; i++) {
d2vgetline(input, line);
if (line.length()) {
ret->files[i] = d2vgetpath(filename, line);
Expand Down Expand Up @@ -187,7 +187,7 @@ d2vcontext *d2vparse(char *filename, string& err)
/* Read in all GOPs. */
i = 0;
d2vgetline(input, line);
while (line.length()) {
while(line.length()) {
string tok;
istringstream ss(line);
int offset;
Expand All @@ -202,7 +202,7 @@ d2vcontext *d2vparse(char *filename, string& err)
ss >> dec >> cur_gop.cell;

offset = 0;
while (!ss.eof()) {
while(!ss.eof()) {
uint16_t flags;
frame f;

Expand Down
23 changes: 14 additions & 9 deletions vs/d2vsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ extern "C" {
#include "decode.hpp"
#include "directrender.hpp"

void VS_CC d2vInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
d2vData *d = (d2vData *) * instanceData;
void VS_CC d2vInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi)
{
d2vData *d = (d2vData *) *instanceData;
vsapi->setVideoInfo(&d->vi, 1, node);
}

const VSFrameRef *VS_CC d2vGetFrame(int n, int activationReason, void **instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi) {
d2vData *d = (d2vData *) * instanceData;
const VSFrameRef *VS_CC d2vGetFrame(int n, int activationReason, void **instanceData, void **frameData,
VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi)
{
d2vData *d = (d2vData *) *instanceData;
VSFrameRef *s, *f;
string msg;
int ret;
Expand Down Expand Up @@ -72,15 +75,17 @@ const VSFrameRef *VS_CC d2vGetFrame(int n, int activationReason, void **instance
return f;
}

void VS_CC d2vFree(void *instanceData, VSCore *core, const VSAPI *vsapi) {
void VS_CC d2vFree(void *instanceData, VSCore *core, const VSAPI *vsapi)
{
d2vData *d = (d2vData *) instanceData;
d2vfreep(&d->d2v);
decodefreep(&d->dec);
av_freep(&d->frame);
free(d);
}

void VS_CC d2vCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi) {
void VS_CC d2vCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi)
{
d2vData *data;
string msg;
bool no_crop;
Expand Down Expand Up @@ -113,14 +118,14 @@ void VS_CC d2vCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core,
data->dec->avctx->get_buffer = VSGetBuffer;
data->dec->avctx->release_buffer = VSReleaseBuffer;

/* Last frame is crashy right now */
/* Last frame is crashy right now. */
data->vi.numFrames = data->d2v->frames.size() - 1;
data->vi.width = data->d2v->width;
data->vi.height = data->d2v->height;
data->vi.fpsNum = data->d2v->fps_num;
data->vi.fpsDen = data->d2v->fps_den;

/* Stash the pointer to our core */
/* Stash the pointer to our core. */
data->core = core;
data->api = (VSAPI *) vsapi;

Expand All @@ -132,7 +137,7 @@ void VS_CC d2vCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core,
data->aligned_height = FFALIGN(data->vi.height, 32);

data->frame = avcodec_alloc_frame();
if(!data->frame) {
if (!data->frame) {
vsapi->setError(out, "Cannot allocate AVFrame.");
return;
}
Expand Down
3 changes: 2 additions & 1 deletion vs/vapoursynth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ extern "C" {

#include "d2vsource.hpp"

VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin) {
VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin)
{
configFunc("com.sources.d2vsource", "d2v", "D2V Source", VAPOURSYNTH_API_VERSION, 1, plugin);
registerFunc("Source", "input:data;nocrop:int:opt;", d2vCreate, 0, plugin);
}

0 comments on commit 049ef05

Please sign in to comment.