Ticket #4215: 4215_fix.diff

File 4215_fix.diff, 1.4 KB (added by skamithi, 14 years ago)

attempt to implemented suggested changes.works fine on i945 and fx5200 before and after [14692]

  • libs/libmythtv/videooutbase.cpp

     
    13991399    // Copy Y (intensity values)
    14001400    for (int i = 0; i < piph; i++)
    14011401    {
    1402         memcpy(frame->buf + (i + yoff) * frame->width + xoff,
     1402        memcpy(frame->buf + (i + yoff) * frame->pitches[0] + xoff,
    14031403               pipbuf + i * pipw, pipw);
    14041404    }
    14051405
     
    14071407    xoff /= 2;
    14081408    yoff /= 2;
    14091409
    1410     unsigned char *uptr = frame->buf + frame->width * frame->height;
    1411     unsigned char *vptr = frame->buf + frame->width * frame->height * 5 / 4;
    1412     int vidw = frame->width / 2;
     1410    unsigned char *uptr = frame->buf + frame->offsets[1];
     1411    unsigned char *vptr = frame->buf + frame->offsets[2];
    14131412
    14141413    unsigned char *pipuptr = pipbuf + pipw * piph;
    14151414    unsigned char *pipvptr = pipbuf + pipw * piph * 5 / 4;
     
    14171416
    14181417    for (int i = 0; i < piph / 2; i ++)
    14191418    {
    1420         memcpy(uptr + (i + yoff) * vidw + xoff, pipuptr + i * pipw, pipw);
    1421         memcpy(vptr + (i + yoff) * vidw + xoff, pipvptr + i * pipw, pipw);
     1419        memcpy(uptr + (i + yoff) * frame->pitches[1] + xoff, pipuptr + i * pipw, pipw);
     1420        memcpy(vptr + (i + yoff) * frame->pitches[2] + xoff, pipvptr + i * pipw, pipw);
    14221421    }
    14231422
    14241423    // we're done with the frame, release it