Skip to content

Commit f563759

Browse files
committed
Merge branches 'autoexpand' and 'libav' into all
3 parents f698093 + 917ea20 + 4b0eb46 commit f563759

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

libmpdemux/demux_lavf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int lavf_check_file(demuxer_t *demuxer)
154154
{
155155
struct MPOpts *opts = demuxer->opts;
156156
struct lavfdopts *lavfdopts = &opts->lavfdopts;
157-
AVProbeData avpd;
157+
AVProbeData avpd = {0};
158158
lavf_priv_t *priv;
159159
int probe_data_size = 0;
160160
int read_size = INITIAL_PROBE_SIZE;

libvo/aspect.c

+15-3
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,27 @@ void aspect_fit(struct vo *vo, int *srcw, int *srch, int fitw, int fith)
6969
mp_msg(MSGT_VO, MSGL_DBG2, "aspect(0) fitin: %dx%d screenaspect: %.2f\n",
7070
fitw, fith, vo->monitor_aspect);
7171
*srcw = fitw;
72-
*srch = (float)fitw / aspdat->prew * aspdat->preh * pixelaspect;
72+
if (vo_fs) {
73+
float scale_ratio = (float)fitw / aspdat->prew;
74+
if (scale_ratio > 1 && scale_ratio < 1.01)
75+
*srcw = aspdat->prew;
76+
}
77+
*srch = (float)*srcw / aspdat->prew * aspdat->preh * pixelaspect;
7378
*srch += *srch % 2; // round
7479
mp_msg(MSGT_VO, MSGL_DBG2, "aspect(1) wh: %dx%d (org: %dx%d)\n",
7580
*srcw, *srch, aspdat->prew, aspdat->preh);
7681
if (*srch > fith || *srch < aspdat->orgh) {
77-
int tmpw = (float)fith / aspdat->preh * aspdat->prew / pixelaspect;
82+
int tmpw, tmph;
83+
tmph = fith;
84+
if (vo_fs) {
85+
float scale_ratio = (float)fith / aspdat->preh;
86+
if (scale_ratio > 1 && scale_ratio < 1.01)
87+
tmph = aspdat->preh;
88+
}
89+
tmpw = (float)tmph / aspdat->preh * aspdat->prew / pixelaspect;
7890
tmpw += tmpw % 2; // round
7991
if (tmpw <= fitw) {
80-
*srch = fith;
92+
*srch = tmph;
8193
*srcw = tmpw;
8294
} else if (*srch > fith) {
8395
mp_tmsg(MSGT_VO, MSGL_WARN,

0 commit comments

Comments
 (0)