dvb: move adapter number set-up by way of environment to dvbsrc

This logic did not belong to the channel configuration
parser (only used by dvbbasebin) but to dvbsrc, which
is the element directly using this value and honoring
the "adapter" property.

Allows previously non-working cases like this to work:

GST_DVB_ADAPTER=1 gst-launch-1.0 dvbsrc delsys=11 modulation=7 frequency=689000000 ! fakesink
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2016-12-22 16:08:30 -08:00
parent 61b7b1856e
commit 3e519937a1
2 changed files with 8 additions and 6 deletions

View file

@ -1022,6 +1022,7 @@ static void
gst_dvbsrc_init (GstDvbSrc * object)
{
int i = 0;
const gchar *adapter;
GST_DEBUG_OBJECT (object, "Kernel DVB API version %d.%d", DVB_API_VERSION,
DVB_API_VERSION_MINOR);
@ -1044,7 +1045,13 @@ gst_dvbsrc_init (GstDvbSrc * object)
object->pids[0] = 8192;
object->pids[1] = G_MAXUINT16;
object->dvb_buffer_size = DEFAULT_DVB_BUFFER_SIZE;
object->adapter_number = DEFAULT_ADAPTER;
adapter = g_getenv ("GST_DVB_ADAPTER");
if (adapter)
object->adapter_number = atoi (adapter);
else
object->adapter_number = DEFAULT_ADAPTER;
object->frontend_number = DEFAULT_FRONTEND;
object->diseqc_src = DEFAULT_DISEQC_SRC;
object->send_diseqc = (DEFAULT_DISEQC_SRC != -1);

View file

@ -885,7 +885,6 @@ set_properties_for_channel (GstElement * dvbbasebin,
{
gboolean ret = FALSE;
gchar *filename;
const gchar *adapter;
filename = g_strdup (g_getenv ("GST_DVB_CHANNELS_CONF"));
if (filename == NULL) {
@ -893,10 +892,6 @@ set_properties_for_channel (GstElement * dvbbasebin,
"gstreamer-" GST_API_VERSION, "dvb-channels.conf", NULL);
}
adapter = g_getenv ("GST_DVB_ADAPTER");
if (adapter)
g_object_set (dvbbasebin, "adapter", atoi (adapter), NULL);
switch (detect_file_format (filename)) {
case CHANNEL_CONF_FORMAT_DVBV5:
if (!parse_and_configure_from_v5_conf_file (dvbbasebin, filename,