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 675359 - [0.11] Frame-based multi threaded decoding is broken with gst-ffmpegdec
[0.11] Frame-based multi threaded decoding is broken with gst-ffmpegdec
Status: RESOLVED DUPLICATE of bug 678365
Product: GStreamer
Classification: Platform
Component: gst-libav
0.11.x
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-03 10:10 UTC by Matej Knopp
Modified: 2012-06-19 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.73 KB, application/octet-stream)
2012-05-03 10:10 UTC, Matej Knopp
  Details
Patch (2.33 KB, patch)
2012-05-03 14:58 UTC, Matej Knopp
none Details | Review
Patch (2.58 KB, patch)
2012-05-03 17:16 UTC, Matej Knopp
none Details | Review

Description Matej Knopp 2012-05-03 10:10:18 UTC
Created attachment 213361 [details]
Patch

This has been broken for quite some time. The problem is empty buffer being sent to the decoder on drain before any other data has been sent. This causes the first decoding thread not being initialized properly and the first actual frame being decoded in second thread. 

With check to prevent drain when no data has been sent yet the decoding works. The patch also enables frame based decoding by default, if this is not desirable I can disable it. The decoding does introduce latency of 1 frame per thread, but the performance benefits are significant.
Comment 1 Matej Knopp 2012-05-03 14:55:02 UTC
Actually, the empty buffer on drain causes problems even with data in. I modified the patch to not attempt to drain the decoder in frame-threading mode at all. The entire draining code looks weird to me, does anyone know any actual libav decoder that needs/supports draining? It does make sense for encoders, but why would a decoder create latency if it doesn't have to?
Comment 2 Matej Knopp 2012-05-03 14:58:05 UTC
Created attachment 213387 [details] [review]
Patch
Comment 3 Matej Knopp 2012-05-03 17:16:08 UTC
Created attachment 213394 [details] [review]
Patch

After discussing this some more with Ronald Bultje at #libav the problem is that the decoder may only be drained on EOS. It must not be drained at any other point. 

In gst-ffmpegdec it is currently drained on segment event and discont, which is wrong.
Comment 4 Wim Taymans 2012-06-11 14:35:10 UTC
commit a3c7cd4643719f1eec1f885c6634e1f4dbdf8f71
Author: Matej Knopp <matej.knopp@gmail.com>
Date:   Thu May 3 19:02:09 2012 +0200

    gstffmpegdec: only drain on EOS
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=675359
Comment 5 Matej Knopp 2012-06-19 16:11:12 UTC

*** This bug has been marked as a duplicate of bug 678365 ***