Opened 10 years ago
Closed 10 years ago
#5065 closed defect (fixed)
skip_transcode never returns True
Reported by: | anongoblin | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.8.0 |
Component: | programming | Keywords: | |
Cc: | Parent Tickets: |
Description
In mediagoblin/media_types/video/util.py, skip_transcode
The return type of tags.get_string is a tuple, (bool, value) (ref https://lazka.github.io/pgi-docs/Gst-1.0/structs/TagList.html#Gst.TagList.get_string)
This code assumes that the return value is just a string. As such, it will always return False.
Example:
39 if configmime_types and tags.get_string('mimetype'):
40 if not tags.get_string('mimetype') in configmime_types:
41 return False
If there is no mimetype string in tags, then tags.get_string('mimetype') returns:
(False, None)
Which allows the test on line 40 to pass. Of course, (False, None) does not appear in the list of mimetypes in the config.
In each case, the initial existence test needs a [0] after the get_string, and the second test needs a [1] after the get_string. E.g.:
39 if configmime_types and tags.get_string('mimetype')[0]:
40 if not tags.get_string('mimetype')[1] in configmime_types:
41 return False
(raised as anongoblin as registration is disabled)
Attachments (1)
Change History (5)
by , 10 years ago
Attachment: | fix-skip-transcode.patch added |
---|
comment:1 by , 10 years ago
Milestone: | → 0.8.0 |
---|
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fix patch