dvbsrc: set common PES filter params once and reuse

Avoid setting the same harcoded values over and over again.
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2016-06-06 12:25:22 -07:00
parent faf6e5a1eb
commit c66f5080aa

View file

@ -2763,6 +2763,12 @@ gst_dvbsrc_set_pes_filters (GstDvbSrc * object)
GST_INFO_OBJECT (object, "Setting PES filter"); GST_INFO_OBJECT (object, "Setting PES filter");
/* Set common params for all filters */
pes_filter.input = DMX_IN_FRONTEND;
pes_filter.output = DMX_OUT_TS_TAP;
pes_filter.pes_type = DMX_PES_OTHER;
pes_filter.flags = DMX_IMMEDIATE_START;
for (i = 0; i < MAX_FILTERS; i++) { for (i = 0; i < MAX_FILTERS; i++) {
if (object->pids[i] == G_MAXUINT16) if (object->pids[i] == G_MAXUINT16)
break; break;
@ -2780,10 +2786,6 @@ gst_dvbsrc_set_pes_filters (GstDvbSrc * object)
g_return_if_fail (*fd != -1); g_return_if_fail (*fd != -1);
pes_filter.pid = pid; pes_filter.pid = pid;
pes_filter.input = DMX_IN_FRONTEND;
pes_filter.output = DMX_OUT_TS_TAP;
pes_filter.pes_type = DMX_PES_OTHER;
pes_filter.flags = DMX_IMMEDIATE_START;
GST_INFO_OBJECT (object, "Setting PES filter: pid = %d, type = %d", GST_INFO_OBJECT (object, "Setting PES filter: pid = %d, type = %d",
pes_filter.pid, pes_filter.pes_type); pes_filter.pid, pes_filter.pes_type);