Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when --strip is applied to an already stripped mp3 file #20

Open
rstemmer opened this issue Dec 14, 2021 · 1 comment
Open

Error when --strip is applied to an already stripped mp3 file #20

rstemmer opened this issue Dec 14, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@rstemmer
Copy link
Owner

Error when --strip is applied to an already stripped mp3 file

Reproduce:

base64 --decode > ./test.mp3 << EOF
//uUZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAAE4ADj4+Pj
4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj////////////////
//////////////////////////////////////////////////8AAABQTEFNRTMuMTAwBLkAAAAA
AAAAADUgJAaQjQAB4AAABOClHWotAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//vURAAAAioAXeAAAAA5
wAvMAAAAC4wteee9gQGnBW7495govjctbLXcgH1CAEATB8/E4IAg6DgIHMEMTg4CAIBjEAIO6wfD
HrD+D+CAJv/g4CAIAgGAfB8Hz//+CAIZQMfD//lwfB8H9HLb40kq8nBOD59YPg+XB8QAgciQEKwf
BDh7wfB8H/xACAIHMu/E4P//qBAMYIBj/Wa9Z/Ln8QA+H97e/M6SJuONIhFC3AZgMwmwuQ4lUdoc
RpE6A8IxOLX5rJjUFQVOwVBU6sFQVDTpUFQVBoGvBUFYKgqGuoGj0RB2oGga5UFQVBY9+IgZDXLH
vgqCuCoK/4iBk7/9W71Vv1JmlL0l1COiGmSkAhxpE6IMW0FSOEfs23NBSRLSoKgrBUFQ1BUFQ0oF
TpYGgZOqBoGmwVBUFga+oGgZBVwiBoFYieoGgaPSwdwWBoO/1gqCsqCuDLlA0DVQNB2WBoGgaBU7
/1gqCypMQU1FMy4xMDCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq//sUZMsP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
EOF

id3edit --strip ./test.mp3

Error:

ID: '' (FFFB94) not supported!
ID3V2_Open failed with error -2!

id3edit should just exit with error code 0 because the file is in a state the user wants it to be.

@rstemmer rstemmer added the bug Something isn't working label Dec 14, 2021
@rstemmer
Copy link
Owner Author

I added this situation to the test-script.
The solution is a bit difficult because of bad code. The function ID3V2_Open does more than just opening the file. It reads it and checks the ID3v2 Tag.

I need to split it the following way:

  1. Open file and check if ID3v2 Tag exists
  2. If not:
    2.1. Create one if --create is given
    2.2. Exit with success if --strip is given
    2.3. Exit with error
  3. Continue reading the rest of the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant