[vlc-commits] demux: timestamp_filters: update reused es codec

Francois Cartegnie git at videolan.org
Mon Jan 13 18:09:43 CET 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 12 15:07:32 2019 +0100| [1ba55988c62e67dc9aecb6642288b31053d3a157] | committer: Francois Cartegnie

demux: timestamp_filters: update reused es codec

(cherry picked from commit 9ba4510892d9cac72de3140debe93297978db6fb)

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

 modules/demux/timestamps_filter.h | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/modules/demux/timestamps_filter.h b/modules/demux/timestamps_filter.h
index 50d45b8d94..c2fab014f0 100644
--- a/modules/demux/timestamps_filter.h
+++ b/modules/demux/timestamps_filter.h
@@ -111,6 +111,18 @@ static void timestamps_filter_push(const char *s, struct timestamps_filter_s *tf
     mva_add(&tf->mva, i_dts, i_length);
 }
 
+static struct tf_es_out_id_s * timestamps_filter_es_out_getID(struct tf_es_out_s *p_sys, es_out_id_t *id)
+{
+    for(int i=0; i<p_sys->es_list.i_size; i++)
+    {
+        struct tf_es_out_id_s *cur = (struct tf_es_out_id_s *)p_sys->es_list.p_elems[i];
+        if(cur->id != id)
+            continue;
+        return cur;
+    }
+    return NULL;
+}
+
 static void timestamps_filter_es_out_Reset(struct tf_es_out_s *out)
 {
     for(int i=0; i<out->es_list.i_size; i++)
@@ -152,6 +164,15 @@ static int timestamps_filter_es_out_Control(es_out_t *out, int i_query, va_list
             timestamps_filter_es_out_Reset(p_sys);
             break;
         }
+        case ES_OUT_SET_ES_FMT:
+        {
+            es_out_id_t *id = va_arg(va_list, es_out_id_t *);
+            const es_format_t *p_fmt = va_arg(va_list, es_format_t *);
+            struct tf_es_out_id_s *cur = timestamps_filter_es_out_getID(p_sys, id);
+            if(cur)
+                cur->fourcc = p_fmt->i_codec;
+            return es_out_Control(p_sys->original_es_out, ES_OUT_SET_ES_FMT, id, p_fmt);
+        }
         /* Private controls, never forwarded */
         case ES_OUT_TF_FILTER_GET_TIME:
         {
@@ -175,18 +196,6 @@ static int timestamps_filter_es_out_Control(es_out_t *out, int i_query, va_list
     return es_out_vaControl(p_sys->original_es_out, i_query, va_list);
 }
 
-static struct tf_es_out_id_s * timestamps_filter_es_out_getID(struct tf_es_out_s *p_sys, es_out_id_t *id)
-{
-    for(int i=0; i<p_sys->es_list.i_size; i++)
-    {
-        struct tf_es_out_id_s *cur = (struct tf_es_out_id_s *)p_sys->es_list.p_elems[i];
-        if(cur->id != id)
-            continue;
-        return cur;
-    }
-    return NULL;
-}
-
 static int timestamps_filter_es_out_Send(es_out_t *out, es_out_id_t *id, block_t *p_block)
 {
     struct tf_es_out_s *p_sys = (struct tf_es_out_s *) out->p_sys;



More information about the vlc-commits mailing list