Platform bug using getstream on ARM

Vojtech Horky vojtech.horky at gmail.com
Tue Jan 26 12:10:07 CET 2010


Hi,
2010/1/25 Stuart Hopkins <stuart at linux-depot.com>:
> Hi,
>  I've used getstream on x86 platforms for a few years now and have found it
> reliable and fast, and to that end have just been trying to use it on my
> Sheevaplug (ARM v5 compatible). I ran into a problem however where no matter
> what arguments were passed it would error by just showing the options
> list...
>
> It seems that the command line parsing is broken on ARM, and im not sure if
> its with a library or the check, but if you change below to getstream.c
> (line 114):
>
> while((ch=getopt(argc, argv, "c:dt:")) != -1) {
>
> to
>
> while((ch=getopt(argc, argv, "c:dt:")) != 255) {
>
> it then works correctly and streams data fine. On my little plug PC it uses
> around 2% when processing all channels on a single DVB mux.
>
> Any chance the code can be adjusted/edited to compensate for the check
> condition, unless 255 doesn't work on x86?
According to manual, getopt returns int and -1 in case of error.
However, in the source, ch is char and thus some automatic
type-casting happens and the problem is probably caused by different
char signedness. IMHO the correct solution is to declare ch as int and
leave the rest as is.
>
> Regards
>
> Stuart

Regards
- Vojta


More information about the Getstream mailing list