GNOME Bugzilla – Bug 722290
avviddec: mark buffers as corrupted if libav tells us so
Last modified: 2014-01-16 12:47:27 UTC
In 0.10 I had a workaround that checked for buffer flags (delta units and discont) to know whether I had received a key frame. The workaround was used for clients connected to a gst-rtsp-server based server that didn't receive a key frame as the first buffer. Another solution would be to fix that in the server (some work has been done regarding this, lately, see bug 711257). In 1.0, the delta unit is used properly and frames that can be decoded (even there's a missing reference frame) are not marked with any flags. However this frame will have information that shouldn't really be displayed to the user. So, it would be nice if buffers that come before a synchronization point would be marked with the corrupted flag.
Created attachment 266385 [details] [review] mark buffers as corrupted Proposal to mark buffers as corrupted if no sync point has arrived before.
This came out after a short conversation with Olivier on IRC where he made that suggestion when I commented about the 0.10 and 1.0 differences I found. So, this is just a proposal. May be there's currently another way to achieve this or a better way to implement it.
Frames before the first keyframe are not necessarily corrupted, in some cases they can be decoded without problems. Still might be useful to mark them somehow, but the corrupted flag seems wrong for this reason.
(In reply to comment #3) > Frames before the first keyframe are not necessarily corrupted, in some cases > they can be decoded without problems. > > Still might be useful to mark them somehow, but the corrupted flag seems wrong > for this reason. Agreed, I couldn't find any other flag that made sense though. As I mention in the bug description frames can still be decoded, but it would be nice to mark them some how so the user can choose what to do with them.
I just filed a bug to libav to see if it is possible to add information to know if frames can be decoded even the reference key frame is not present. https://bugzilla.libav.org/show_bug.cgi?id=628
Created attachment 266396 [details] [review] mark buffers as corrupted in avviddec We mark buffers as corrupted if they were decoded but no key frame was found before. Actually, it would be better to use another buffer flag to properly indicate this (as Sebastian has pointed). Also, this could happen in the middle of the stream, so the buffers will not be marked properly with this patch. However, if I am not wrong, this is something that would need to be added in libav.
Better to use the flag that libav provides us :) commit d494f6f9837d1fff575d0959cdb2e817855d8d6e Author: Sebastian Dröge <sebastian@centricular.com> Date: Thu Jan 16 13:45:58 2014 +0100 avauddec: Mark frames as corrupted if libav tells us they are This is currently only implemented by the h264 codec and no audio codec. https://bugzilla.gnome.org/show_bug.cgi?id=722290 commit b278ca55bec70bafbd5c1d2ba9a8a1d4fa24ec7f Author: Sebastian Dröge <sebastian@centricular.com> Date: Thu Jan 16 13:44:56 2014 +0100 avviddec: Mark frames as corrupted if libav tells us they are This is currently only implemented by the h264 codec. https://bugzilla.gnome.org/show_bug.cgi?id=722290