[vlc-devel] [PATCH] demux: adaptive: fix es recyling

Zhao Zhili quinkblack at foxmail.com
Thu May 17 05:47:14 CEST 2018



On 2018年05月17日 04:37, Francois Cartegnie wrote:
> Le 14/05/2018 à 15:19, Zhao Zhili a écrit :
>>
>> I have tried to revert 5ff52a41a and test, it's not related to
>> the bug.
>>
>> The patch I submitted is a by-product which is not related to the
>> bug too. I didn't get the point why break the loop instead of
>> continue. I have tested with HLS which has multiple audio tracks
>> in single TS, and select the second or the third track manually.
>> The loop breaks with the first audio track which not looks right.
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> I don't see how you change can fix the issue, since there's always a max
> or one category of each es in recycle queue, the break makes sense.

Sorry I didn't get the point why break the loop. Here is a test
with HLS sample which has three audio track in single TS, the
third is selected, and then seek.

diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp 
b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index 73b3995..dfb7c87 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -120,9 +120,14 @@ void FakeESOut::createOrRecycleRealEsID( 
FakeESOutID *es_id )
      vlc_mutex_lock(&lock);

      bool b_select = false;
+    int i = 0;
+    if (es_id->getFmt()->i_cat == AUDIO_ES) {
+            printf("==========\n");
+    }
      for( it=recycle_candidates.begin(); it!=recycle_candidates.end(); 
++it )
      {
          FakeESOutID *cand = *it;
+
          if ( cand->isCompatible( es_id ) )
          {
              realid = cand->realESID();
@@ -137,7 +142,10 @@ void FakeESOut::createOrRecycleRealEsID( 
FakeESOutID *es_id )
                 Otherwise the es will select any other compatible track
                 and will end this in a activate/select loop when 
reactivating a track */
              es_out_Control( real_es_out, ES_OUT_GET_ES_STATE, 
cand->realESID(), &b_select );
-            break;
+            if (es_id->getFmt()->i_cat == AUDIO_ES) {
+                printf("loop %d, b_select %d\n", ++i, b_select);
+            }
+            //break;
          }
      }

==========
loop 1, b_select 0
loop 2, b_select 0
loop 3, b_select 1
==========
loop 1, b_select 0
loop 2, b_select 0
loop 3, b_select 0
==========
loop 1, b_select 0
loop 2, b_select 0
loop 3, b_select 0

> So I believe your issue happens only with ts with 1 video and 1 audio
> es, and the audio is deselected, then seeked.
>
> I don't know what your sample is, see POC on "keep new decoders
> deselected state". List doesn't seem to want to link thread with your
> Message-ID.
>

For ticket #20436, it doesn't matter how many audio tracks. The
keypoint to reproduce is the following check failed:

/* Reject audio streams with different or unknown rates */
if(fmt.audio.i_rate != p_other->fmt.audio.i_rate || !fmt.audio.i_rate)
      return false;

Not only the deselected state is changed after seek, but also the
selected audio track is changed too for multiple audio tracks
samples. It's another issue.




More information about the vlc-devel mailing list