[vlc-commits] demux: timestamp_filters: update reused es codec
Francois Cartegnie
git at videolan.org
Wed Dec 18 20:59:29 CET 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 12 15:07:32 2019 +0100| [9ba4510892d9cac72de3140debe93297978db6fb] | committer: Francois Cartegnie
demux: timestamp_filters: update reused es codec
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ba4510892d9cac72de3140debe93297978db6fb
---
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 fded8b5f5a..4492b13652 100644
--- a/modules/demux/timestamps_filter.h
+++ b/modules/demux/timestamps_filter.h
@@ -112,6 +112,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++)
@@ -153,6 +165,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:
{
@@ -176,18 +197,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 = container_of(out, struct tf_es_out_s, es_out);
More information about the vlc-commits
mailing list