GNOME Bugzilla – Bug 738292
directsoundsrc: hRes unckecked, which may cause a endless loop
Last modified: 2015-12-11 10:48:43 UTC
In gst_directsound_src_read, line 533 and line 547, hRes not checked. When recording with a usb recorder, it may come to a endless loop if the recorder is plugged out.
Created attachment 288213 [details] [review] A patch for the bug Add the check of hRes
Review of attachment 288213 [details] [review]: ::: gstdirectsoundsrc.c @@ +536,2 @@ /* Starting capturing if not already */ + if (SUCCEEDED (hRes) && !(dwStatus & DSCBSTATUS_CAPTURING)) { I think if not succeeded it should return here already instead of going into the loop below
Yongjian Xu, do you agree with Sebastian's suggestion? If yes, could you update the patch accordingly and test it to make sure that fixes your issue as well?
I would like to fix all the Error Handling Bugs in directsoundsrc and directsoundsink. Same here: https://bugzilla.gnome.org/show_bug.cgi?id=734098 I think Sebastian is right - the check should be before the loop what about that: if (FAILED (hRes)) { GST_DSOUND_UNLOCK (dsoundsrc); return -1; }
Thomas, feel free to take up those patches and get them ready for merging. That would be great :)
Created attachment 317196 [details] [review] fix Bug 738292 - directsoundsrc: hRes unckecked, which may cause a endless loop there you are
commit d794908dfdb726a2156512a495044a3941cad1a9 Author: Thomas Roos <thomas.roos@industronic.de> Date: Fri Dec 11 11:39:08 2015 +0100 directsoundsrc: Check return values of DirectSound functions in read loop Otherwise we might end up in an infinite loop because of errors. Also take the element's mutex in unprepare(). https://bugzilla.gnome.org/show_bug.cgi?id=738292