After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797006 - vaapidec: Requests a GstForceKeyUnit in case of parse/decode error.
vaapidec: Requests a GstForceKeyUnit in case of parse/decode error.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
1.14.0
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 796099 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-08-22 01:39 UTC by Matteo Valdina
Modified: 2018-09-03 14:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Requests GstForceKeyUnit to the upstream in case of parse/decode error. (1.82 KB, patch)
2018-08-22 01:39 UTC, Matteo Valdina
none Details | Review
Patch for requesting key unit in case of error (1.55 KB, patch)
2018-08-24 00:46 UTC, Matteo Valdina
none Details | Review
Patch for requesting key unit in case of error (1.55 KB, patch)
2018-08-24 00:47 UTC, Matteo Valdina
none Details | Review
Requests GstForceKeyUnit to the upstream in case of parse/decode error. (1.55 KB, patch)
2018-08-24 00:48 UTC, Matteo Valdina
none Details | Review
Initializing return value. (960 bytes, patch)
2018-08-24 00:51 UTC, Matteo Valdina
none Details | Review
Initializing return value. (931 bytes, patch)
2018-09-01 01:59 UTC, Matteo Valdina
committed Details | Review
Requests GstForceKeyUnit to the upstream in case of parse/decode error. (1.67 KB, patch)
2018-09-01 01:59 UTC, Matteo Valdina
committed Details | Review

Description Matteo Valdina 2018-08-22 01:39:33 UTC
Created attachment 373421 [details] [review]
Requests GstForceKeyUnit to the upstream in case of parse/decode error.

This is a follow up of issue: https://bugzilla.gnome.org/show_bug.cgi?id=796863

Requests GstForceKeyUnit to the upstream in case of parse/decode error.

In the case of decode error, there is a change that affects other cases.
The "GstFlowret value was never initialized in some condition and so it was undefined.

I saw by experience that it was 0 (GST_FLOW_OK) but this is a random behavior and tied to the specific compiler/cpu/kernel and other factors.
I added a default value that it makes sense for my understanding of this codebase. But I'm probably wrong.

At least I think it is better because it is a defined behavior.

I saw that there are other functions that have this issue like gst_vaapidecode_push_all_decoded_frames where "ret" is returned in the default switch with the un-initialized value.
Comment 1 Nicolas Dufresne (ndufresne) 2018-08-22 01:43:14 UTC
Review of attachment 373421 [details] [review]:

Can you split the uninitialized value fix in its own patch please. Then we can add the correct bug ref in which that regression happened. Then you have break twice now.
Comment 2 Matteo Valdina 2018-08-22 01:57:54 UTC
Sorry, I'm not 100% sure what you prefer.

Do you want that I split the patch and open a different bug for uninitialized or is it enough to split the patch in two separate patches but in this bug?
Comment 3 Víctor Manuel Jáquez Leal 2018-08-22 10:31:46 UTC
I guess it is enough to split the patch and post both here, in the same bug.
Comment 4 Nicolas Dufresne (ndufresne) 2018-08-22 10:56:58 UTC
Yes that's fine, we will update the bug uri upon merge.
Comment 5 Matteo Valdina 2018-08-24 00:46:59 UTC
Created attachment 373446 [details] [review]
Patch for requesting key unit in case of error
Comment 6 Matteo Valdina 2018-08-24 00:47:36 UTC
Created attachment 373447 [details] [review]
Patch for requesting key unit in case of error
Comment 7 Matteo Valdina 2018-08-24 00:48:09 UTC
Created attachment 373448 [details] [review]
Requests GstForceKeyUnit to the upstream in case of parse/decode error.
Comment 8 Matteo Valdina 2018-08-24 00:51:24 UTC
Created attachment 373449 [details] [review]
Initializing return value.
Comment 9 Matteo Valdina 2018-08-24 00:53:17 UTC
Sorry for the noise, multiple submit of the patch file.

This is a split and simplified version of the original patch.
Comment 10 Víctor Manuel Jáquez Leal 2018-08-28 16:32:04 UTC
Review of attachment 373448 [details] [review]:

::: gst/vaapi/gstvaapidecode.c
@@ +1186,1 @@
       /* just keep parsing, the decoder should have flushed the broken unit */

above this there a 

GST_ERROR ("parse error %d", status);

Change it to GST_WARNING(...

Though, I'm not sure if we should ditch the rest of frames until the key unit, or just drop the broken one.
Comment 11 Víctor Manuel Jáquez Leal 2018-08-29 12:08:18 UTC
Ah, another thing!

Could you make, the patch for the initializing return value, the first one, and the key unit the second one. This is because the initializing issue is a bug that have to be backported into other branches, so making it independent of the new feature, will make the backport easier.
Comment 12 Matteo Valdina 2018-08-29 12:41:37 UTC
Yes, for sure.

Thanks
Comment 13 Nicolas Dufresne (ndufresne) 2018-08-31 18:38:32 UTC
*** Bug 796099 has been marked as a duplicate of this bug. ***
Comment 14 Matteo Valdina 2018-09-01 01:59:29 UTC
Created attachment 373533 [details] [review]
Initializing return value.
Comment 15 Matteo Valdina 2018-09-01 01:59:59 UTC
Created attachment 373534 [details] [review]
Requests GstForceKeyUnit to the upstream in case of parse/decode error.
Comment 16 Matteo Valdina 2018-09-01 02:01:27 UTC
Addressed comments, rebase on current master.

Thanks for the feedback.
Comment 17 Víctor Manuel Jáquez Leal 2018-09-03 13:54:34 UTC
Comment on attachment 373533 [details] [review]
Initializing return value.

Commited the first patch with the bug fix, but I changed it a bit because ret is used by GST_VIDEO_DECODER_ERROR, so the returna value had to be defined before.
Comment 18 Víctor Manuel Jáquez Leal 2018-09-03 14:06:06 UTC
Comment on attachment 373533 [details] [review] [review]
Initializing return value.

Also pushed in branch 1.14

* 947a3204 (origin/1.14) vaapidecode: sets return value in failure case.