[ http://dev.sourcefabric.org/browse/LS-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16072#action_16072 ]
David Baelde commented on LS-478: --------------------------------- The changeset is 7a59a2e26b1e. This isn't a great solution but it'll do for now. We can work on a better SDL init in the future, when somebody starts using SDL more seriously. Here's my remarks for the record anyway... The solution moves the font lookup to runtime of the source. This delays the error which tells users that the font is unknown -- also, it raises that Lang.Invalid_value error at streaming time, while it is expected only in our code when executing the script (there probably isn't a generic printer for that error to report it in a user-friendly way). Also, if the #get_font method had been made private, there would have been no need to add a coercion to source ((new text ... ...):>Source.source). > Cannot use video.add_text since SDL init changes > ------------------------------------------------ > > Key: LS-478 > URL: http://dev.sourcefabric.org/browse/LS-478 > Project: Liquidsoap > Issue Type: Bug > Components: Liquidsoap > Environment: current dev version > Reporter: David Baelde > Assignee: Romain Beauxis > Priority: Blocker > Fix For: 1.0 > > > $ ./src/liquidsoap 'output.dummy(video.add_text("foo",blank()))' > Invalid value at line 1, char 28-42: Library not initialized. > The problem is that SDL is only initialized when streaming starts, just > before sources are woken up, but the text operator initializes its font upon > creation and not upon #wake_up. This in itself is (slightly) incorrect since > resources should only be allocated within #wake_up and #sleep, but it is > useful to check that the font exists. > The simplest solution is that all SDL operators call Sdl_utils.init which > inits with all options if not already done. The current architecture tries to > do better by not initializing components that don't need to. This is nice but > I don't see why it's necessary. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://dev.sourcefabric.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Savonet-devl mailing list Savonet-devl@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-devl