git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea85265
)
fixed negative width/height bug
author
kramm
<kramm>
Tue, 22 Feb 2005 18:51:41 +0000
(18:51 +0000)
committer
kramm
<kramm>
Tue, 22 Feb 2005 18:51:41 +0000
(18:51 +0000)
avi2swf/videoreader_avifile.cc
patch
|
blob
|
history
avi2swf/videoreader_vfw.cc
patch
|
blob
|
history
diff --git
a/avi2swf/videoreader_avifile.cc
b/avi2swf/videoreader_avifile.cc
index
afe4f54
..
d1b06f0
100644
(file)
--- a/
avi2swf/videoreader_avifile.cc
+++ b/
avi2swf/videoreader_avifile.cc
@@
-265,11
+265,11
@@
int videoreader_avifile_open(videoreader_t* v, char* filename)
printf("fps: %d\n", 1000000/head.dwMicroSecPerFrame);
printf("frames: %d\n", head.dwTotalFrames);
printf("streams: %d\n", head.dwStreams);
printf("fps: %d\n", 1000000/head.dwMicroSecPerFrame);
printf("frames: %d\n", head.dwTotalFrames);
printf("streams: %d\n", head.dwStreams);
- printf("width: %d\n", head.dwWidth);
- printf("height: %d\n", head.dwHeight);
+ printf("width: %d\n", abs(head.dwWidth));
+ printf("height: %d\n", abs(head.dwHeight));
printf("sound: %u samples (%f seconds)\n", i->astream->GetEndPos(), i->astream->GetEndTime());
printf("sound: %u samples (%f seconds)\n", i->astream->GetEndPos(), i->astream->GetEndTime());
- v->width = head.dwWidth;
- v->height = head.dwHeight;
+ v->width = abs(head.dwWidth);
+ v->height = abs(head.dwHeight);
dwMicroSecPerFrame = head.dwMicroSecPerFrame;
samplesperframe = astream->GetEndPos()/astream->GetEndTime()*head.dwMicroSecPerFrame/1000000;
v->samplerate = (int)(astream->GetEndPos()/astream->GetEndTime());
dwMicroSecPerFrame = head.dwMicroSecPerFrame;
samplesperframe = astream->GetEndPos()/astream->GetEndTime()*head.dwMicroSecPerFrame/1000000;
v->samplerate = (int)(astream->GetEndPos()/astream->GetEndTime());
@@
-280,8
+280,8
@@
int videoreader_avifile_open(videoreader_t* v, char* filename)
{
StreamInfo*videoinfo;
videoinfo = i->vstream->GetStreamInfo();
{
StreamInfo*videoinfo;
videoinfo = i->vstream->GetStreamInfo();
- v->width = videoinfo->GetVideoWidth();
- v->height = videoinfo->GetVideoHeight();
+ v->width = abs(videoinfo->GetVideoWidth());
+ v->height = abs(videoinfo->GetVideoHeight());
v->fps = (double)(videoinfo->GetFps());
}
if(i->do_audio)
v->fps = (double)(videoinfo->GetFps());
}
if(i->do_audio)
diff --git
a/avi2swf/videoreader_vfw.cc
b/avi2swf/videoreader_vfw.cc
index
91555e1
..
ca8a6b7
100644
(file)
--- a/
avi2swf/videoreader_vfw.cc
+++ b/
avi2swf/videoreader_vfw.cc
@@
-73,8
+73,8
@@
static int bitmap_to_rgba(BITMAPINFOHEADER*bi, void*buffer, const int dest_width
ULONG*dest = (ULONG*)buffer;
ULONG*dest = (ULONG*)buffer;
- int width = bi->biWidth;
- int height = bi->biHeight;
+ int width = abs(bi->biWidth);
+ int height = abs(bi->biHeight);
if(dest_width != width || dest_height != height) {
/* TODO: size conversion */
fprintf(stderr, "size mismatch: %dx%d != %dx%d\n", width, height, dest_width, dest_height);
if(dest_width != width || dest_height != height) {
/* TODO: size conversion */
fprintf(stderr, "size mismatch: %dx%d != %dx%d\n", width, height, dest_width, dest_height);
@@
-326,11
+326,11
@@
int videoreader_vfw_open(videoreader_t* vr, char* filename)
if(1) {
i->bitmap = bitmap;
i->vs = stream;
if(1) {
i->bitmap = bitmap;
i->vs = stream;
- i->width = bitmap.biWidth;
- i->height = bitmap.biHeight;
+ i->width = abs(bitmap.biWidth);
+ i->height = abs(bitmap.biHeight);
} else {
fprintf(stderr, "Ignoring video stream: %dx%d compression=%d planes=%d\n",
} else {
fprintf(stderr, "Ignoring video stream: %dx%d compression=%d planes=%d\n",
- bitmap.biWidth, bitmap.biHeight,
+ abs(bitmap.biWidth), abs(bitmap.biHeight),
bitmap.biCompression,bitmap.biPlanes);
}
}
bitmap.biCompression,bitmap.biPlanes);
}
}