GNOME Bugzilla – Bug 696684
Problems feeding wavparse with 0-byte file
Last modified: 2013-04-08 23:33:11 UTC
Linking a filesrc pointing to a 0-byte file to the wavparse causes an assertion in gst_wavparse_add_src_pad
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
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.
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).
Ok, sounds reasonable. I will take another look at this soon.
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.
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