Skip to content

Commit

Permalink
Set colorspace details for unknown video formats in alffplay
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Feb 20, 2025
1 parent 412c64f commit 1982a70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/alffplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,10 @@ void VideoState::updateVideo(SDL_Window *screen, SDL_Renderer *renderer, bool re
frame->width, frame->height, static_cast<AVPixelFormat>(frame->format),
frame->width, frame->height, AV_PIX_FMT_RGB24, 0,
nullptr, nullptr, nullptr)};

sws_setColorspaceDetails(mSwscaleCtx.get(), sws_getCoefficients(frame->colorspace),
(frame->color_range==AVCOL_RANGE_JPEG), sws_getCoefficients(SWS_CS_DEFAULT), 1,
0<<16, 1<<16, 1<<16);
}
}

Expand Down

0 comments on commit 1982a70

Please sign in to comment.