Opendigitalradio / dablin

DAB/DAB+ receiver for Linux (including ETI-NI and EDI AF playback)
GNU General Public License v3.0
123 stars 27 forks source link

Additions for RAW TCP ETI Reciever #39

Closed maceyldn closed 5 years ago

maceyldn commented 6 years ago

C is sadly not my language... (you will see when you look at the code ;) )

but under the windows build i created, i needed the ability to recieve data through a TCP port without external apps.

This enables that, slight difference to the command line options, but that is explained in --help

It also contains some modifications to build under Cygwin.

Regards Andy

basicmaster commented 6 years ago

Hi Andy,

thanks for your MR! I will (hopefully) be able to review it at the weekend. I might ask you to do slightly adjustments to your contribution before merging it ;-)

Regards, Stefan

maceyldn commented 6 years ago

LOL No Problem at all.

I fully expect it. My C is terrible!

Andy

basicmaster commented 6 years ago

Some first findings/questions; I haven't checked the main part yet.

I hope all this is not too frustrating ;-) I think it makes sense for you to wait with any changes until the "main review" before applying changes.

basicmaster commented 6 years ago

Sorry for the delay; I just had a further look at your changes. In general your changes add the ability to play from a TCP source. In addition to the above mentioned issues, I found the following:

There is a big "if" in eti_source.cpp to handle the URL case instead of the file case. This is not really good style. As the URL/file ways have many commonalities, it makes sense to use the C++ inheritance mechanism to have a base class. From this base class two sub-classes could inherit and handle the URL and the file cases differently i.e. at the code location where different code would be used, a function is called that is implemented differently for each sub-class (e.g. init, reading etc.).

Sometimes a plain exit call is used, instead of return. This prevents proper clean-up of the current state and should not be used.

Sometimes empty lines are added/removed without real need. The change should be kept as minimal as possible, so that the changes remain clear.

basicmaster commented 5 years ago

In general, using a separate application to access a TCP source (e.g. netcat) more aligns with the KISS principle. Furthermore, since over a year there has been no update here. For this reasons I close this MR and hope, this is OK for you.