Correctly handle case where buffer is 100% full
authorRamiro Polla <ramiro.polla@gmail.com>
Sat, 8 Mar 2008 23:06:33 +0000 (23:06 +0000)
committerRamiro Polla <ramiro.polla@gmail.com>
Sat, 8 Mar 2008 23:06:33 +0000 (23:06 +0000)
Originally committed as revision 12389 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavdevice/vfwcap.c

index aa3a788..26273be 100644 (file)
@@ -189,7 +189,7 @@ static int shall_we_drop(struct vfw_ctx *ctx)
     const int ndropscores = sizeof(dropscore)/sizeof(dropscore[0]);
     unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer;
 
-    if(dropscore[++ctx->frame_num%ndropscores] < buffer_fullness) {
+    if(dropscore[++ctx->frame_num%ndropscores] <= buffer_fullness) {
         av_log(ctx->s, AV_LOG_ERROR,
               "real-time buffer %d%% full! frame dropped!\n", buffer_fullness);
         return 1;