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

Files longer than 24 hours are not handled correctly #10

Closed
dm413 opened this issue Mar 26, 2019 · 4 comments
Closed

Files longer than 24 hours are not handled correctly #10

dm413 opened this issue Mar 26, 2019 · 4 comments
Assignees
Labels
wip Work in progress

Comments

@dm413
Copy link
Contributor

dm413 commented Mar 26, 2019

I am processing audio files that are 6 days long. When I call GetMetaDataAsync, the duration is returned as zero. Also I do not get Progress events after 24 hours of audio have been processed.

This happens because the code uses TimeSpan.TryParse to parse the duration string that is output by ffmpeg. TimeSpan.TryParse does not handle hours that are greater than 23 (it expects days). Ffmpeg however produces a duration in h:mm:ss.fff format where the hours field can grow as large as necessary.

@cmxl
Copy link
Owner

cmxl commented Apr 26, 2019

Hi @dm413 and thanks for your contribution!
I'd like to merge your pullrequest, but I feel a bit unsure as long as there is no test for this function.
Do you mind adding one?

@cmxl cmxl added the wip Work in progress label Apr 26, 2019
@dm413
Copy link
Contributor Author

dm413 commented Apr 29, 2019

Added two tests, one for GetMetadataAsync and one for Progress events. I'm not experienced with xunit tests; let me know if there are problems.

One issue was creating a file with > 24 hours duration to test with. I didn't want to put a large (175 MB) file into the repo, so the test program creates the test file at run time, by copying the SampleAudio file many times until the file is about 31 hours long . This means the first time you run the test it takes 10 to 20 seconds to create the test audio file.

@cmxl
Copy link
Owner

cmxl commented Apr 30, 2019

Thank you!
I will look into it after work ;)

@cmxl cmxl self-assigned this Apr 30, 2019
cmxl pushed a commit that referenced this issue Apr 30, 2019
* Bug fix for issue #10: Files longer than 24 hours
See #10
GetMetaData did not return the correct duration for files that have a duration longer than 24 hours. And Progress events stopped occurring after processing 24 hours.

* Add tests for files with duration greater than 24 hours.
@cmxl
Copy link
Owner

cmxl commented Apr 30, 2019

thanks again @dm413!
tests were also absolutely fine :)

@cmxl cmxl closed this as completed Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work in progress
Projects
None yet
Development

No branches or pull requests

2 participants