[vlc-commits] vdpau/chroma: skip forward to current picture if forced (fixes #11410)

Rémi Denis-Courmont git at videolan.org
Mon Sep 15 18:43:35 CEST 2014


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep 15 19:16:18 2014 +0300| [5be64170c8cec4847434bdd4e19e8fe98782c815] | committer: Rémi Denis-Courmont

vdpau/chroma: skip forward to current picture if forced (fixes #11410)

VDPAU introduces a delay of one field (one picture if not deinterlacing).
This is normally not an issue as the PTS is preserved. But it does not
work if there is only one picture not followed by another one.

(cherry picked from commit 6e82ebed93d6f017af4369d8712f7063421ee9ca)

Conflicts:
	modules/hw/vdpau/chroma.c

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=5be64170c8cec4847434bdd4e19e8fe98782c815
---

 modules/hw/vdpau/chroma.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index 126cf29..1fe511c 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -478,14 +478,35 @@ static picture_t *VideoRender(filter_t *filter, picture_t *src)
         picture_Release(src);
     }
     else
+    {
         sys->history[MAX_PAST + MAX_FUTURE].field = NULL;
+        sys->history[MAX_PAST + MAX_FUTURE].force = false;
+    }
 
     if (dst == NULL)
         goto skip;
 
     vlc_vdp_video_field_t *f = sys->history[MAX_PAST].field;
     if (f == NULL)
-        goto error;
+    {   /* There is no present field, probably just starting playback. */
+        if (!sys->history[MAX_PAST + MAX_FUTURE].force)
+            goto error;
+
+        /* If the picture is forced, ignore deinterlacing and fast forward. */
+        /* FIXME: Remove the forced hack pictures in video output core and
+         * allow the last field of a video to be rendered properly. */
+        while (sys->history[MAX_PAST].field == NULL)
+        {
+            f = sys->history[0].field;
+            if (f != NULL)
+                f->destroy(f);
+
+            memmove(sys->history, sys->history + 1,
+                    sizeof (sys->history[0]) * (MAX_PAST + MAX_FUTURE));
+            sys->history[MAX_PAST + MAX_FUTURE].field = NULL;
+        }
+        f = sys->history[MAX_PAST].field;
+    }
 
     dst->date = sys->history[MAX_PAST].date;
     dst->b_force = sys->history[MAX_PAST].force;



More information about the vlc-commits mailing list