Commit edaffcc8 authored by Laurent Aimar's avatar Laurent Aimar

Modified vout_SetDisplayAspect() to take a DAR instead of a SAR.

parent d22b9922
......@@ -85,7 +85,7 @@ VLC_EXPORT(void, vout_SetDisplayFullscreen, (vout_display_t *, bool is_fullscree
VLC_EXPORT(void, vout_SetDisplayFilled, (vout_display_t *, bool is_filled));
VLC_EXPORT(void, vout_SetDisplayZoom, (vout_display_t *, int num, int den));
VLC_EXPORT(void, vout_SetWindowState, (vout_display_t *, unsigned state));
VLC_EXPORT(void, vout_SetDisplayAspect, (vout_display_t *, unsigned sar_num, unsigned sar_den));
VLC_EXPORT(void, vout_SetDisplayAspect, (vout_display_t *, unsigned dar_num, unsigned dar_den));
VLC_EXPORT(void, vout_SetDisplayCrop, (vout_display_t *, unsigned crop_num, unsigned crop_den, unsigned x, unsigned y, unsigned width, unsigned height));
VLC_EXPORT(vout_opengl_t *, vout_GetDisplayOpengl, (vout_display_t *));
......
......@@ -1128,10 +1128,20 @@ void vout_SetWindowState(vout_display_t *vd, unsigned state)
vlc_mutex_unlock(&osys->lock);
}
void vout_SetDisplayAspect(vout_display_t *vd, unsigned sar_num, unsigned sar_den)
void vout_SetDisplayAspect(vout_display_t *vd, unsigned dar_num, unsigned dar_den)
{
vout_display_owner_sys_t *osys = vd->owner.sys;
unsigned sar_num, sar_den;
if (dar_num > 0 && dar_den > 0) {
sar_num = dar_num * osys->source.i_visible_height;
sar_den = dar_den * osys->source.i_visible_width;
vlc_ureduce(&sar_num, &sar_den, sar_num, sar_den, 0);
} else {
sar_num = 0;
sar_den = 0;
}
if (osys->sar.num != sar_num || osys->sar.den != sar_den) {
osys->ch_sar = true;
osys->sar.num = sar_num;
......
......@@ -1175,13 +1175,6 @@ static void ThreadChangeZoom(vout_thread_t *vout, int num, int den)
static void ThreadChangeAspectRatio(vout_thread_t *vout,
unsigned num, unsigned den)
{
const video_format_t *source = &vout->p->original;
if (num > 0 && den > 0) {
num *= source->i_visible_height;
den *= source->i_visible_width;
vlc_ureduce(&num, &den, num, den, 0);
}
vout_SetDisplayAspect(vout->p->display.vd, num, den);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment