[vlc-commits] demux: adaptative: enforce es selection when recycling incompatible es

Francois Cartegnie git at videolan.org
Tue Nov 10 11:17:42 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 10 10:52:48 2015 +0100| [fe8e6262fc6daf213dbe13522549594b43f413e5] | committer: Francois Cartegnie

demux: adaptative: enforce es selection when recycling incompatible es

With multiple audio tracks, es would select another when deleting
current es/not recyling.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe8e6262fc6daf213dbe13522549594b43f413e5
---

 modules/demux/adaptative/plumbing/FakeESOut.cpp |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/demux/adaptative/plumbing/FakeESOut.cpp b/modules/demux/adaptative/plumbing/FakeESOut.cpp
index 93bec26..bd46507 100644
--- a/modules/demux/adaptative/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptative/plumbing/FakeESOut.cpp
@@ -91,6 +91,7 @@ void FakeESOut::createOrRecycleRealEsID( FakeESOutID *es_id )
     std::list<FakeESOutID *>::iterator it;
     es_out_id_t *realid = NULL;
 
+    bool b_select = false;
     for( it=recycle_candidates.begin(); it!=recycle_candidates.end(); ++it )
     {
         FakeESOutID *cand = *it;
@@ -102,10 +103,21 @@ void FakeESOut::createOrRecycleRealEsID( FakeESOutID *es_id )
             recycle_candidates.erase( it );
             break;
         }
+        else if( cand->getFmt()->i_cat == es_id->getFmt()->i_cat )
+        {
+            /* We need to enforce same selection when not reused
+               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 );
+        }
     }
 
     if( !realid )
+    {
         realid = es_out_Add( real_es_out, es_id->getFmt() );
+        if( b_select )
+            es_out_Control( real_es_out, ES_OUT_SET_ES_STATE, realid, b_select );
+    }
 
     es_id->setRealESID( realid );
 }



More information about the vlc-commits mailing list