mhsabbagh / green-recorder

A simple screen recorder for Linux desktop. Supports Wayland & Xorg
GNU General Public License v3.0
616 stars 118 forks source link

Undefined button #122

Closed mashu closed 5 years ago

mashu commented 5 years ago
~$ green-recorder 
You are recording on: wayland
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 4.8.2 (GCC) 2014011120 (Red Hat 4.8.2-15)
  configuration: --prefix=/home/mateusz/miniconda3/envs/ml --disable-doc --disable-openssl --enable-shared --enable-static --extra-cflags='-Wall -g -m64 -pipe -O3 -march=x86-64 -fPIC' --extra-cxxflags='-Wall -g -m64 -pipe -O3 -march=x86-64 -fPIC' --extra-libs='-lpthread -lm -lz' --enable-zlib --enable-pic --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libopenh264
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Unknown input format: 'pulse'
Traceback (most recent call last):
  File "/usr/bin/green-recorder", line 463, in recordclicked
    record()
  File "/usr/bin/green-recorder", line 323, in record
    RecordGnome()
  File "/usr/bin/green-recorder", line 216, in RecordGnome
    recorderindicator()
  File "/usr/bin/green-recorder", line 107, in recorderindicator
    indicator.set_secondary_activate_target(stoprecordingbutton)
NameError: global name 'stoprecordingbutton' is not defined
^C

Ffmpeg downloaded from debian-multimedia, cause it's recent build supporting nvidia encoder.

mhsabbagh commented 5 years ago

I don't have this issue here. Tested on Ubuntu 18.x with Wayland GNOME Session (3.28).

mashu commented 5 years ago

Issue is present in git and error indicates undefined global variable. And bad code is in line 107 where variable is referenced before being defined, you can check code yourself, I am looking at it and its a bug.

mhsabbagh commented 5 years ago

You didn't understand: Yes it's referenced before assignment, but still there's no issue in recording. All the buttons and the system tray work without an issue.

BlackArbsCEO commented 5 years ago

I have this same issue, with Ubuntu 18.04 x11 session. Recording is also affected.

sebix commented 5 years ago

Same issue here

Traceback (most recent call last):
  File "/usr/bin/green-recorder", line 463, in recordclicked
    record()
  File "/usr/bin/green-recorder", line 319, in record
    RecordXorg()
  File "/usr/bin/green-recorder", line 175, in RecordXorg
    recorderindicator()
  File "/usr/bin/green-recorder", line 107, in recorderindicator
    indicator.set_secondary_activate_target(stoprecordingbutton)
NameError: global name 'stoprecordingbutton' is not defined
mashu commented 5 years ago

Why not to close this, if bug fixed (month ago) ? This may sound harsh but mistake was what most if not all introductory programming courses teach, not to assign to undefined variables. This was one-line fix, so embarrassingly simple that no one even bothered to contribute a patch.

Having such an error, should signal something to author or trigger an effort to self-asked question why this bug ended up in git? For example how other projects prevent that type of code from happening. These are basic programming practices (industry standards), so author could do not only a favour to community, but also to himself by learning what automatic tests are. It might be difficult to find employment without knowing this basic stuff.

I am upset here, because I pointed out an obvious mistake and author not only replied that he sees no issue, but what's more disturbing, he didn't take an effort to think why his code is so bad and what other people do to prevent this.

There are plenty of learning resources online.

mhsabbagh commented 5 years ago

@mashu I don't owe you nor anybody else any work at all, even if it was 1 line of code. None of you are my "customers"; This is a free software that I do in my spare time, and unless my time allows me to trigger a new build, it would never happen.

To be more frank here: I don't follow any standards, tests or practices because this program is nothing more than a frontend for ffmpeg + D-Bus that I mainly developed it for my own use, but took an extra step of putting it on GitHub for other people' use too. And I also took part of my time to setup a PPA + OBS repository for most major distributions, and I also fix issues and implement features that have nothing to do with my usage case, just to help people.

That's why neither this bug, nor any bug in the future will "trigger" me to do anything extra. This is not Docker nor Kubernetes, no automated tests and no automated builds will happen, simply because I am not ready to invest more hours of my free time on this. If you don't like it, fork the code and build the packages yourself, the code is licensed under GPL 3.

Clearly that 1-liner is simply a typo. Your stupid assumption that the author doesn't know that "you shouldn't assign undefined variables", and your continuous rant about how "so bad" the code is and that the author should get basic programming courses, is outrageous.

As a result of the above you are banned from participating in anything related to the project, or any other project I do in the future.

sebix commented 5 years ago

Thanks, I can confirm this bug is fixed

JerryAtHub commented 5 years ago

Censorship might be normal in authoritarian countries, where criticising goverment is a crime, but is in opposite direction to values such as freedom and definitly not in the spirit of OpenSource software.

Instead of ignoring a bug and replying to fellow developers "you don't understand", you could as well ask for help in adding basic testing infrastrcuture, which takes no more than ~15min to set up.

Putting GPL code on everything does not free you from responsibility of what you are sharing, because someone might actually try to use it or worst take it as an example to learn from.

mhsabbagh commented 5 years ago

@JerryAtHub Your account was created at GitHub 43 minutes ago and this your only participation in that account. So I understand you are the previous user. This is not censorship, this is simply blocking rude users from an open source project, under any CoC your previous comment could suspend your activity in any project you would be participating in, because you are attacking the person, not the issue.

You could also instead of blaming your fellow developer, help in creating the infrastructure and submit the needed patches. But you didn't do that, instead, you started a rant, and how the author needs basic programming courses.

Clearly you have no idea about what GPL is, because it clearly says there's no warranty, no responsibility nor anything else associated with the source code: https://github.com/foss-project/green-recorder/blob/efa919f2b5389b337f739f6fc270341af5f29d5c/green-recorder#L10