Ticket #462: pipaspect.diff

File pipaspect.diff, 2.3 KB (added by anonymous, 14 years ago)
  • mythtv/libs/libmythtv/videooutbase.cpp

    diff -ur mythsvn-7466/mythtv/libs/libmythtv/videooutbase.cpp mythsvn-local/mythtv/libs/libmythtv/videooutbase.cpp
    old new  
    169169    ZoomedIn(0),              ZoomedUp(0),              ZoomedRight(0),
    170170
    171171    // Picture-in-Picture stuff
    172     PIPLocation(0),
     172    PIPLocation(0),           desired_pipsize(26),
    173173    desired_piph(128),        desired_pipw(160),
    174174    piph_in(-1),              pipw_in(-1),
    175175    piph_out(-1),             pipw_out(-1),
     
    568568    if (imgw == 1920 && imgh == 1088)
    569569        imgh = 1080; // ATSC 1920x1080
    570570
    571     // Set an appropriate PiP size
    572     if (imgh > 1000)
    573         (desired_pipw = 368), (desired_piph = 288);
    574     else if (imgh > 700)
    575         (desired_pipw = 240), (desired_piph = 192);
    576     else
    577         (desired_pipw = 160), (desired_piph = 128);
    578 
    579571    // Get display aspect and correct for rounding errors
    580572    displayAspect = GetDisplayAspect();
    581573
     
    10391031    int pipw, piph;
    10401032
    10411033    VideoFrame *pipimage = pipplayer->GetCurrentFrame(pipw, piph);
     1034    float pipvideoAspect = pipplayer->GetVideoAspect();
    10421035
    1043     if (!pipimage || !pipimage->buf || pipimage->codec != FMT_YV12)
     1036    if (videoAspect <= 0
     1037        || frame->height <= 0
     1038        || frame->width <= 0
     1039        || !pipimage
     1040        || !pipimage->buf
     1041        || pipimage->codec != FMT_YV12)
    10441042    {
    10451043        pipplayer->ReleaseCurrentFrame(pipimage);
    10461044        return;
    10471045    }
     1046   
     1047    desired_piph = frame->height * desired_pipsize / 100;
     1048    desired_pipw = (int) ((frame->width * desired_pipsize / 100) * (pipvideoAspect / videoAspect));
     1049    desired_piph -= desired_piph % 2;
     1050    desired_pipw -= desired_pipw % 2;
    10481051
    10491052    int xoff;
    10501053    int yoff;
  • mythtv/libs/libmythtv/videooutbase.h

    diff -ur mythsvn-7466/mythtv/libs/libmythtv/videooutbase.h mythsvn-local/mythtv/libs/libmythtv/videooutbase.h
    old new  
    327327
    328328    // Picture-in-Picture
    329329    int PIPLocation;
     330    int desired_pipsize;
    330331    int desired_piph;
    331332    int desired_pipw;
    332333    int piph_in;