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 696684 - Problems feeding wavparse with 0-byte file
Problems feeding wavparse with 0-byte file
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Linux
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-27 10:35 UTC by Alexander Schrab
Modified: 2013-04-08 23:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (887 bytes, patch)
2013-03-27 11:03 UTC, Alexander Schrab
needs-work Details | Review
Patch #2 (8.72 KB, patch)
2013-04-08 09:50 UTC, Alexander Schrab
committed Details | Review

Description Alexander Schrab 2013-03-27 10:35:08 UTC
Linking a filesrc pointing to a 0-byte file to the wavparse causes an assertion in gst_wavparse_add_src_pad
Comment 1 Alexander Schrab 2013-03-27 10:36:28 UTC
gst-launch-1.0 filesrc location=/dev/null ! wavparse ! fakesink

or

touch /tmp/empty
gst-launch-1.0 filesrc location=/tmp/empty ! wavparse ! fakesink

Causes:

** (gst-launch-1.0:12874): CRITICAL **: gst_pad_set_caps: assertion `caps != NULL && gst_caps_is_fixed (caps)' failed
Comment 2 Alexander Schrab 2013-03-27 11:03:12 UTC
Created attachment 239942 [details] [review]
Patch

There is already a check if wav->caps is null or not. I simply moved the set_caps to inside this.
Comment 3 Tim-Philipp Müller 2013-03-28 13:42:08 UTC
I don't know if that's the right solution, or if the code in wavparse is right.

I don't think gst_wavparse_add_src_pad() should be called if we don't know the output caps.

So if we haven't gotten a pad yet when we get the EOS event it should error out saying that this is not a WAV file (both in pull mode and push mode).
Comment 4 Alexander Schrab 2013-04-04 10:52:15 UTC
Ok,
sounds reasonable. I will take another look at this soon.
Comment 5 Alexander Schrab 2013-04-08 09:50:44 UTC
Created attachment 240931 [details] [review]
Patch #2

If, when we get eos, we haven't recieved any valid data. We only report error and skip the EOS reporting.

Also a regression unit test.
Comment 6 Tim-Philipp Müller 2013-04-08 23:32:59 UTC
Thanks, pushed with miniscule changes (use g_assert, push eos event after posting error message; use default error message string and use text as error debug message instead):

 commit 7e91057934ed2fd1db4409d673ece183627185e8
 Author: Tim-Philipp Müller <tim@centricular.net>
 Date:   Tue Apr 9 00:28:54 2013 +0100

    tests: refactor new wavparse test a little
    
    Use fakesrc instead of filesrc with /dev/null.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696684

 commit 79d5a7d03c34c96b1d7bb971ac22948c25fe9365
 Author: Alexander Schrab <alexas@axis.com>
 Date:   Mon Apr 8 11:38:33 2013 +0200

    wavparse: error out if we receive eos before any valid data
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696684