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? Regards Stuart
Hi, 2010/1/25 Stuart Hopkins <stuart@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
Hi, Tested here and it works fine (changing ch to int and resetting condition check back to -1) Stuart Vojtech Horky wrote:
Hi, 2010/1/25 Stuart Hopkins <stuart@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 _______________________________________________ Getstream mailing list Getstream@gt.owl.de http://gt.owl.de/mailman/listinfo/getstream
On Tue, Jan 26, 2010 at 12:10:07PM +0100, Vojtech Horky wrote:
Hi, 2010/1/25 Stuart Hopkins <stuart@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 -- Florian Lohoff f@zz.de "Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat im Internet Zensur- und Überwachungsabsichten zu unterstellen." - - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin
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@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@gt.owl.de http://gt.owl.de/mailman/listinfo/getstream
participants (3)
-
Florian Lohoff -
Stuart Hopkins -
Vojtech Horky