[vlc-commits] [Git][videolan/vlc][master] 2 commits: test: input_decoder: remove assertion on pf_flush

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Apr 20 10:02:36 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
446b4e8b by Alexandre Janniaux at 2023-04-20T09:37:10+00:00
test: input_decoder: remove assertion on pf_flush

Now that decoder_t::pf_flush is called right before every call to
vlc_input_decoder_Delete, there are multiple cases without decoder_flush
scenario entry and keeping it mandatory is not useful anymore.

Since cef875107bc73d0cc6378de893920a9c38219783, this was leading to
spurrious test failure depending on whether the decoder thread exited
before calling flush (no assertion) or if it could reach the call to
pf_flush (assertion failure).

- - - - -
40250776 by Alexandre Janniaux at 2023-04-20T09:37:10+00:00
input: decoder: continue DecoderThread on flush

If the decoder thread is flushing, we don't want to stop right now but
instead we'll finish the calls to pf_flush and ensure everything is in
order for this last loop of the decoder thread.

Without this, an input decoder could miss the call to pf_flush and other
output flush before being deleted.

- - - - -


2 changed files:

- src/input/decoder.c
- test/src/input/decoder/input_decoder.c


Changes:

=====================================
src/input/decoder.c
=====================================
@@ -1716,7 +1716,7 @@ static void *DecoderThread( void *p_data )
     /* The decoder's main loop */
     vlc_fifo_Lock( p_owner->p_fifo );
 
-    while( !p_owner->aborting )
+    while( !p_owner->aborting || p_owner->flushing )
     {
         if( p_owner->flushing )
         {   /* Flush before/regardless of pause. We do not want to resume just


=====================================
test/src/input/decoder/input_decoder.c
=====================================
@@ -96,8 +96,8 @@ static int DecoderDecode(decoder_t *dec, block_t *block)
 static void DecoderFlush(decoder_t *dec)
 {
     struct input_decoder_scenario *scenario = &input_decoder_scenarios[current_scenario];
-    assert(scenario->decoder_flush != NULL);
-    return scenario->decoder_flush(dec);
+    if (scenario->decoder_flush != NULL)
+        scenario->decoder_flush(dec);
 }
 
 static void CloseDecoder(vlc_object_t *obj)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b2af1a26e4da2ae670c2b9d99ca1f6e7400e3950...402507769462ef1d3c98e09b34bbfb6b55d9350c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b2af1a26e4da2ae670c2b9d99ca1f6e7400e3950...402507769462ef1d3c98e09b34bbfb6b55d9350c
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list