Ignore:
Timestamp:
Feb 16, 2012 8:49:33 AM (13 years ago)
Author:
ming
Message:

Re 1446#: Fix division by zero error caused by DShow if video device does not supply AvgTimePerFrame? information (AvgTimePerFrame?=0).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/dshow_dev.c

    r3934 r3953  
    770770        video_info->bmiHeader.biHeight = vfd->size.h; 
    771771    } 
    772     if (!use_def_fps && vfd->fps.num != 0) 
     772    if (video_info->AvgTimePerFrame == 0 || 
     773        (!use_def_fps && vfd->fps.num != 0)) 
     774    { 
    773775        video_info->AvgTimePerFrame = (LONGLONG) (10000000 *  
    774776                                                  (double)vfd->fps.denum / 
    775777                                                  vfd->fps.num); 
     778    } 
    776779    video_info->bmiHeader.biSizeImage = DIBSIZE(video_info->bmiHeader); 
    777780    mediatype->lSampleSize = DIBSIZE(video_info->bmiHeader); 
Note: See TracChangeset for help on using the changeset viewer.