changeset 10786:b6086ba68356

8174117: Improve chain of vp6 decoding Reviewed-by: ddehaven, kcr, mschoene, rhalade
author almatvee
date Tue, 21 Feb 2017 16:43:59 -0800
parents ed7e076028de
children 884b34bd00a1
files modules/javafx.media/src/main/native/gstreamer/plugins/vp6/vp6decoder.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.media/src/main/native/gstreamer/plugins/vp6/vp6decoder.c	Thu Jun 01 17:34:37 2017 +0530
+++ b/modules/javafx.media/src/main/native/gstreamer/plugins/vp6/vp6decoder.c	Tue Feb 21 16:43:59 2017 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -341,8 +341,8 @@
     filter->have_par = FALSE;
     filter->par_num = 0;
     filter->par_den = 0;
-    filter->framerate_num = 0;
-    filter->framerate_den = 0;
+    filter->framerate_num = 25;
+    filter->framerate_den = 1;
     filter->tmp_input_buf = NULL;
     filter->tmp_input_buf_size = 0;
 
@@ -517,6 +517,13 @@
             filter->framerate_den = 1;
         }
 
+        // Make sure framerate is valid
+        if (filter->framerate_num <= 0 || filter->framerate_den <= 0)
+        {
+            filter->framerate_num = 25;
+            filter->framerate_den = 1;
+        }
+
         // Get dimensions
         if (!gst_structure_get_int (s, "width", &filter->width))
             filter->width = 0;