ffmpeg: fixed bytes_per_row calcs: now B_YCbCr422 works OK (video overlay)
This commit is contained in:
parent
61c919f268
commit
64381a7b0f
@ -177,13 +177,14 @@ CalculateBytesPerRowWithColorSpaceAndVideoWidth(color_space colorSpace, int vide
|
|||||||
assert(videoWidth >= 0);
|
assert(videoWidth >= 0);
|
||||||
|
|
||||||
const uint32 kBytesPerRowUnknown = 0;
|
const uint32 kBytesPerRowUnknown = 0;
|
||||||
size_t bytesPerPixel;
|
size_t pixelChunk;
|
||||||
size_t rowAlignment;
|
size_t rowAlignment;
|
||||||
|
size_t pixelsPerChunk;
|
||||||
|
|
||||||
if (get_pixel_size_for(colorSpace, &bytesPerPixel, &rowAlignment, NULL) != B_OK)
|
if (get_pixel_size_for(colorSpace, &pixelChunk, &rowAlignment, &pixelsPerChunk) != B_OK)
|
||||||
return kBytesPerRowUnknown;
|
return kBytesPerRowUnknown;
|
||||||
|
|
||||||
uint32 bytesPerRow = bytesPerPixel * videoWidth;
|
uint32 bytesPerRow = pixelChunk * videoWidth / pixelsPerChunk;
|
||||||
uint32 numberOfUnalignedBytes = bytesPerRow % rowAlignment;
|
uint32 numberOfUnalignedBytes = bytesPerRow % rowAlignment;
|
||||||
|
|
||||||
if (numberOfUnalignedBytes == 0)
|
if (numberOfUnalignedBytes == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user