@@ -266,29 +266,30 @@ describe(testName, () => {
266266 stream . audioEncoder = osn . AudioEncoderFactory . create ( "ffmpeg_aac" , "audio-encoder-simple-streaming-5" ) ;
267267 stream . signalHandler = ( signal ) => { obs . signals . push ( signal ) } ;
268268
269- stream . start ( ) ;
270-
271- let signalInfo = await obs . getNextSignalInfo (
272- EOBSOutputType . Streaming , EOBSOutputSignal . Starting ) ;
273- expect ( signalInfo . type ) . to . equal (
274- EOBSOutputType . Streaming , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
275- expect ( signalInfo . signal ) . to . equal (
276- EOBSOutputSignal . Starting , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
277-
278- signalInfo = await obs . getNextSignalInfo (
279- EOBSOutputType . Streaming , EOBSOutputSignal . Stop ) ;
280- expect ( signalInfo . type ) . to . equal (
281- EOBSOutputType . Streaming , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
282- expect ( signalInfo . signal ) . to . equal (
283- EOBSOutputSignal . Stop , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
284- expect ( signalInfo . code ) . to . equal ( - 3 , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
285-
286- stream . service . update ( { key : obs . userStreamKey } ) ;
287-
288269 const videoEncoder = stream . videoEncoder ;
289270 const audioEncoder = stream . audioEncoder ;
290- osn . SimpleStreamingFactory . destroy ( stream ) ;
291- videoEncoder . release ( ) ;
292- audioEncoder . release ( ) ;
271+ try {
272+ stream . start ( ) ;
273+
274+ let signalInfo = await obs . getNextSignalInfo (
275+ EOBSOutputType . Streaming , EOBSOutputSignal . Starting ) ;
276+ expect ( signalInfo . type ) . to . equal (
277+ EOBSOutputType . Streaming , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
278+ expect ( signalInfo . signal ) . to . equal (
279+ EOBSOutputSignal . Starting , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
280+
281+ signalInfo = await obs . getNextSignalInfo (
282+ EOBSOutputType . Streaming , EOBSOutputSignal . Stop ) ;
283+ expect ( signalInfo . type ) . to . equal (
284+ EOBSOutputType . Streaming , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
285+ expect ( signalInfo . signal ) . to . equal (
286+ EOBSOutputSignal . Stop , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
287+ expect ( signalInfo . code ) . to . equal ( - 3 , GetErrorMessage ( ETestErrorMsg . StreamOutput ) ) ;
288+ } finally {
289+ stream . service . update ( { key : obs . userStreamKey } ) ;
290+ osn . SimpleStreamingFactory . destroy ( stream ) ;
291+ videoEncoder . release ( ) ;
292+ audioEncoder . release ( ) ;
293+ }
293294 } ) ;
294295} ) ;
0 commit comments