X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=avi2swf%2Fvideoreader_vfw.cc;h=ca8a6b72f6af37cae017096f6e6e52a8a9180106;hp=97486b9464bfe74e9d396d23ed59b1441e6daf73;hb=2c719855eac434f01d47ba0717d76de65939d74e;hpb=aa34df2f7434eb76f98ab1438c7d44d66ef418a4 diff --git a/avi2swf/videoreader_vfw.cc b/avi2swf/videoreader_vfw.cc index 97486b9..ca8a6b7 100644 --- a/avi2swf/videoreader_vfw.cc +++ b/avi2swf/videoreader_vfw.cc @@ -37,6 +37,9 @@ typedef struct _videoreader_vfw_internal { BITMAPINFOHEADER bitmap; WAVEFORMATEX waveformat; + int audio_eof; + int video_eof; + int video_pos; int video_end; @@ -70,8 +73,8 @@ static int bitmap_to_rgba(BITMAPINFOHEADER*bi, void*buffer, const int dest_width 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); @@ -323,11 +326,11 @@ int videoreader_vfw_open(videoreader_t* vr, char* filename) 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", - bitmap.biWidth, bitmap.biHeight, + abs(bitmap.biWidth), abs(bitmap.biHeight), bitmap.biCompression,bitmap.biPlanes); } }