#29176 closed defect (bug) (fixed)
Wrong length (duration) in wp_read_video_metadata()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.1 | Priority: | normal |
| Severity: | normal | Version: | 3.6 |
| Component: | Media | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Ran into this when running some tests on uploaded video files.
The length_formatted value was correct, while the length was x 1000. Turned out to be correct in the original meta data, but wrongly overwritten by the tag data. This might be caused by a bug in getID3.
Issues can easily be reproduced using the attached example file.
Patch attached as well.
Attachments (3)
Change History (9)
#1
@
12 years ago
- Keywords has-patch added
- Summary changed from Wrong video length in wp_read_video_metadata() to Wrong length (duration) in wp_read_video_metadata()
#3
@
12 years ago
- Keywords needs-testing removed
- Milestone changed from Awaiting Review to 4.1
You are correct, it is getting clobbered. Also need to change ceil() to round() in wp_read_video_metadata() and wp_read_audio_metadata().
29176.diff does that.
#4
@
12 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 29728:
#5
@
12 years ago
I kind of had the feeling that the ceil() was on purpose as if they are round down, the video could be cut off just before the end.
#6
@
12 years ago
length_formatted is set to the value of playtime_string, which is a prop returned by getID3::analyze() - it is the only value we ever read directly. length is just there in case you want to format your own time string. Without round(), the values can differ: length would be 46 while length_formatted would be 45. I vote for consistency with the values, since ceil() was already converting the float, there was no chance for the user to make that choice.
Patch file