Ticket #4567: 4567-v1.patch

File 4567-v1.patch, 6.2 KB (added by danielk, 16 years ago)

potential fix, needs more testing..

  • libs/libmythtv/avformatdecoder.cpp

     
    11571157            aspect_ratio = 4.0 / 3;
    11581158        }
    11591159
    1160         GetNVP()->SetVideoParams(align_width, align_height, fps,
     1160        GetNVP()->SetVideoParams(enc->width, enc->height, fps,
    11611161                                 keyframedist, aspect_ratio, kScan_Detect,
    11621162                                 dvd_video_codec_changed);
    11631163    }
     
    23402340                uint awidth = width, aheight = height;
    23412341                align_dimensions(context, awidth, aheight);
    23422342
    2343                 GetNVP()->SetVideoParams(awidth, aheight, seqFPS,
     2343                GetNVP()->SetVideoParams(width, height, seqFPS,
    23442344                                         keyframedist, aspect,
    23452345                                         kScan_Detect);
    23462346               
     
    24202420            uint awidth = width, aheight = height;
    24212421            align_dimensions(context, awidth, aheight);
    24222422
    2423             GetNVP()->SetVideoParams(awidth, aheight, seqFPS,
     2423            GetNVP()->SetVideoParams(width, height, seqFPS,
    24242424                                     keyframedist, aspect_ratio,
    24252425                                     kScan_Detect);
    24262426
  • libs/libmythtv/videooutbase.cpp

     
    375375    }
    376376
    377377    display_visible_rect = QRect(0, 0, winw, winh);
     378    video_disp_dim       = QSize(width, height);
     379    width  = (width  + 15) & (~0xf);
     380    height = (height + 15) & (~0xf);
    378381    video_dim            = QSize(width, height);
    379     video_rect           = QRect(QPoint(winx, winy), fix_1080i(video_dim));
     382    video_rect           = QRect(QPoint(winx, winy), fix_1080i(video_disp_dim));
    380383
    381     db_vdisp_profile->SetInput(video_dim);
     384    db_vdisp_profile->SetInput(video_disp_dim);
    382385
    383386    aspectoverride  = db_aspectoverride;
    384387    adjustfill      = db_adjustfill;
     
    603606    (void)myth_codec_id;
    604607    (void)codec_private;
    605608
    606     video_dim = input_size;
     609    video_disp_dim = input_size;
     610    video_dim = QSize((input_size.width()  + 15) & (~0xf),
     611                      (input_size.height() + 15) & (~0xf));
    607612
    608613    db_vdisp_profile->SetInput(video_dim);
    609614
     
    710715QRect VideoOutput::GetVisibleOSDBounds(
    711716    float &visible_aspect, float &font_scaling, float themeaspect) const
    712717{
    713     float dv_w = ((float)video_dim.width())  / display_video_rect.width();
    714     float dv_h = ((float)video_dim.height()) / display_video_rect.height();
     718    float dv_w = ((float)video_disp_dim.width())  / display_video_rect.width();
     719    float dv_h = ((float)video_disp_dim.height()) / display_video_rect.height();
    715720
    716721    uint right_overflow = max((display_video_rect.width()
    717722                                + display_video_rect.left())
     
    723728    // top left and bottom right corners respecting letterboxing
    724729    QPoint tl = QPoint((uint) ceil(max(-display_video_rect.left(),0)*dv_w),
    725730                       (uint) ceil(max(-display_video_rect.top(),0)*dv_h));
    726     QPoint br = QPoint((uint) floor(video_dim.width()-(right_overflow*dv_w)),
    727                        (uint) floor(video_dim.height()-(lower_overflow*dv_h)));
     731    QPoint br = QPoint((uint) floor(video_disp_dim.width()
     732                                    -(right_overflow*dv_w)),
     733                       (uint) floor(video_disp_dim.height()
     734                                    -(lower_overflow*dv_h)));
    728735    // adjust for overscan
    729736    if ((db_scale_vert > 0.0f) || (db_scale_horiz > 0.0f))
    730737    {
     
    762769 */
    763770QRect VideoOutput::GetTotalOSDBounds(void) const
    764771{
    765     return QRect(QPoint(0, 0), video_dim);
     772    return QRect(QPoint(0, 0), video_disp_dim);
    766773}
    767774
    768775/** \fn VideoOutput::ApplyManualScaleAndMove(void)
     
    869876    if (db_scale_horiz > 0)
    870877    {
    871878        float tmp = 1.0f - 2.0f * db_scale_horiz;
    872         video_rect.moveLeft((int) round(video_dim.width() * db_scale_horiz));
    873         video_rect.setWidth((int) round(video_dim.width() * tmp));
     879        video_rect.moveLeft((int) round(video_disp_dim.width() * db_scale_horiz));
     880        video_rect.setWidth((int) round(video_disp_dim.width() * tmp));
    874881
    875882        int xoff = db_move.x();
    876883        if (xoff > 0)
     
    11021109void VideoOutput::MoveResize(void)
    11031110{
    11041111    // Preset all image placement and sizing variables.
    1105     video_rect         = QRect(QPoint(0, 0), fix_1080i(video_dim));
     1112    video_rect         = QRect(QPoint(0, 0), fix_1080i(video_disp_dim));
    11061113    display_video_rect = display_visible_rect;
    11071114
    11081115    // Avoid too small frames for audio only streams (for OSD).
    11091116    if ((video_rect.width() <= 0) || (video_rect.height() <= 0))
    11101117    {
    1111         video_dim  = display_visible_rect.size();
     1118        video_disp_dim = display_visible_rect.size();
     1119        video_dim = QSize(
     1120            (display_visible_rect.size().width()  + 15) & (~0xf),
     1121            (display_visible_rect.size().height() + 15) & (~0xf));
    11121122        video_rect = QRect(QPoint(0, 0), video_dim);
    11131123    }
    11141124
     
    14451455    }
    14461456
    14471457    // adjust for non-square pixels on screen
    1448     float dispPixelAdj = (GetDisplayAspect() * video_dim.height()) /
    1449         video_dim.width();
     1458    float dispPixelAdj = (GetDisplayAspect() * video_disp_dim.height()) /
     1459        video_disp_dim.width();
    14501460
    14511461    // adjust for non-square pixels in video
    14521462    float vidPixelAdj  = pipVideoWidth / (pipVideoAspect * pipVideoHeight);
  • libs/libmythtv/videooutbase.h

     
    273273    float   display_aspect;   ///< Physical aspect ratio of playback window
    274274
    275275    // Video dimensions
    276     QSize   video_dim;        ///< Pixel dimensions of video
     276    QSize   video_dim;        ///< Pixel dimensions of video buffer
     277    QSize   video_disp_dim;   ///< Pixel dimensions of video display area
    277278    float   video_aspect;     ///< Physical aspect ratio of video
    278279
    279280    /// Normally this is the same as videoAspect, but may not be