Platform bug using getstream on ARM

Stuart Hopkins stuart at linux-depot.com
Tue Jan 26 15:08:13 CET 2010


Hi,
    Just grabbed a clean GIT snapshot and it works great on my ARM 
platform, thanks :-)

Stu

Florian Lohoff wrote:
> On Tue, Jan 26, 2010 at 12:10:07PM +0100, Vojtech Horky wrote:
>   
>> 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.
>>     
>
> This bug should show up on all unsigned char architectures - IIRC
> at least s390 should have the same issue (Although s390 doesnt have a
> DVB Card)
>
> I committed this to the git.
>
> --- a/getstream.c
> +++ b/getstream.c
> @@ -106,7 +106,7 @@ struct http_server  *hserver;
>
>  int main(int argc, char **argv) {
>         extern char             *optarg;
> -       char                    ch;
> +       int                     ch;
>         int                     timeout=0;
>         GList                   *al;
>         struct config_s         *config=NULL;
>
> Flo
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Getstream mailing list
> Getstream at gt.owl.de
> http://gt.owl.de/mailman/listinfo/getstream
>   



More information about the Getstream mailing list