[Sumover-dev] [svn commit] r4193 - vic/branches/mpeg4/codec
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Fri Jun 27 16:13:09 BST 2008
Author: piers
Date: Fri Jun 27 16:13:06 2008
New Revision: 4193
Modified:
vic/branches/mpeg4/codec/ffmpeg_codec.cpp
Log:
Tweaked order of calls when checking for resize - probably best not to check unless the frame has decoded properly.
Added extern getpid() declaration for Windows
Modified: vic/branches/mpeg4/codec/ffmpeg_codec.cpp
==============================================================================
--- vic/branches/mpeg4/codec/ffmpeg_codec.cpp (original)
+++ vic/branches/mpeg4/codec/ffmpeg_codec.cpp Fri Jun 27 16:13:06 2008
@@ -7,7 +7,9 @@
#include "debug.h"
#include "ffmpeg_codec.h"
-extern int getpid();
+#ifndef _UNISTD_H
+extern "C" int getpid();
+#endif
FFMpegCodec::FFMpegCodec()
{
@@ -144,6 +146,7 @@
release();
}
width = height = 0;
+ frame_size = 0;
picture = avcodec_alloc_frame();
c = avcodec_alloc_context();
@@ -232,16 +235,15 @@
len = avcodec_decode_video(c, picture, &got_picture, codedstream, size);
- if (c->width != width || c->height != height) {
- debug_msg("ffmpegcodec: resize to %dx%d\n", c->width, c->height);
- resize(c->width, c->height);
- // return len;
- }
-
if (!got_picture || len < 0) {
return -1;
}
-
+
+ if (c->width != width || c->height != height) {
+ debug_msg("ffmpegcodec: resize from %dx%d (framesize:%d) to %dx%d, (size: %d) got_picture: %d, len: %d\n", width, height,
+ frame_size, c->width, c->height, size, got_picture, len);
+ resize(c->width, c->height);
+ }
/*
if(avpicture_deinterlace((AVPicture *)picture, (AVPicture *)picture,
c->pix_fmt, c->width, c->height) < 0) {
More information about the Sumover-dev
mailing list