[MPlayer-dev-eng] Proposed patch: DVB API 5 support for DVB-S / DVB-S2

Konstantin kb at inr.ru
Wed Apr 1 14:25:10 CEST 2009


On Tue, 31 Mar 2009, Reimar D?ffinger wrote:

> On Tue, Mar 31, 2009 at 02:54:46PM +0400, Konstantin wrote:
>> +#if DVB_API_VERSION >= 5 // {
>> +#endif // }
>
> I at least have to wonder where you got the idea for those comments...
> First, they seem completely useless, they provide no additional
> information at all (contrary to the usual comments in MPlayer that
> repeat the condition for #else and #endif), but also IIRC // comments
> are not allowed on preprocessor lines, only /* */ comments are.
>

The strange comments like '// {' may [ should ] be removed. I use them to quickly
jump around, or hilight the ifdef-braced fragment of code using 'find matching brace'
editor's keystroke. '//' comment style was choosen to allow '{' or '}' be the last
character in the line. Patch code should comply with project's coding style.
I agree with any changes leading to that.

>> @@ -725,6 +781,21 @@
>>    }
>>    usleep(100000);
>>
>> +#if DVB_API_VERSION >= 5 // {
>> +	/* discard stale QPSK events */
>> +	while (1) {
>> +		struct dvb_frontend_event ev;
>> +		if (ioctl(fd_frontend, FE_GET_EVENT, &ev) == -1)
>> +		break;
>> +	}
>> +
>> +	// FIXME: cmdseq_tune is prepared for DVB-S / DVB-S2 only !
>> +	// Code for other frontend types should be written above
>> +	if ((ioctl(fd_frontend, FE_SET_PROPERTY, &cmdseq_tune)) == -1) {
>> +		perror("FE_SET_PROPERTY failed");
>> +		return -1;
>> +	}
>> +#else // } {
>>  #ifndef CONFIG_DVB_HEAD
>>    if (fd_sec) SecGetStatus(fd_sec, &sec_state);
>>    while(1)
>> @@ -739,6 +810,7 @@
>>      mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR tuning channel\n");
>>      return -1;
>>    }
>> +#endif // }
>
> This seems wrong, with DVB_API_VERSION >= 5 feparams is calculated but
> never used.

The feparams variable is used, not by itself, but as 'feparams.frequency'.
It accepts properly calculated Intermediate Frequency and then occur
at the right side of assignment. That may be written in more consistent
way, but I tried to minimise changed lines count.

> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>



More information about the MPlayer-dev-eng mailing list