Whats wrong with this ?
Code:
const int src_width = src->GetRowSize(PLANAR_Y)
vi.width is width in pixels, GetRowSize(PLANAR_Y) gets row size in bytes of Y if Planar and also works ok with YUY2 / RGB.
I should not imagine that anything has changed in AVS+