--- libmpcodecs/vf_filmdint.c-save2 Sun Dec 7 19:18:09 2003 +++ libmpcodecs/vf_filmdint.c Mon Dec 8 01:23:08 2003 @@ -1136,6 +1136,7 @@ int dropped_fields = 0; double start_time, diff_time; char prev_chflag = p->chflag; + int keep_rate; if (!p->planes[0][0]) init(p, mpi); @@ -1180,22 +1181,25 @@ p->diff_time += diff_time - start_time; breaks = p->inframes ? find_breaks(p, s) : 2; p->inframes++; + keep_rate = 4*p->in_inc == p->out_dec; switch (breaks) { case 0: case 8: case 9: case 10: - if (p->notout < p->num_fields && p->iosync < 2*p->in_inc) + if (!keep_rate && p->notout < p->num_fields && p->iosync < 2*p->in_inc) break; if (p->notout < p->num_fields) dropped_fields = -2; case 4: - if (p->iosync >= -2*p->in_inc) + if (keep_rate || p->iosync >= -2*p->in_inc) show_fields = (4<num_fields)-1; break; case 3: - if (p->iosync > 0) { + if (keep_rate) + show_fields = 2; + else if (p->iosync > 0) { if (p->notout >= p->num_fields && p->iosync > 2*p->in_inc) { show_fields = 4; /* prev odd only */ if (p->num_fields > 1) @@ -1226,7 +1230,9 @@ break; } default: - if (p->notout >= p->num_fields && + if (keep_rate) + show_fields = 3 << (breaks & 1); + else if (p->notout >= p->num_fields && p->iosync >= (breaks == 1 ? -p->in_inc : p->in_inc << (p->num_fields == 1))) { show_fields = (1 << (2 + p->num_fields)) - (1<out_dec < p->in_inc) { + mp_msg(MSGT_VFILTER, MSGL_FATAL, + "filmdint: increasing the frame rate is not supported\n"); return 0; } }