bakape / thumbnailer

Go media thumbnailer
MIT License
152 stars 36 forks source link

EOF interpretation #61

Closed halfshoe closed 4 years ago

halfshoe commented 4 years ago

Good day. Some time ago I ran into a problem of interaction of your package and minio-go package. There is link to Issue. I investigated the problem further and found out the following. When minio-go reaches the end of the file, it returns the number of bytes read and the flag EOF. A read callback from your package will certainly interpret this as an error. Maybe it makes sense to change line 218 from the ffmpeg.go file?

Was if err != nil {. Now if err != nil && err != io.EOF {?

bakape commented 4 years ago

I was not passing EOF properly from Go to FFmpeg, escalating it to critical error. Please see, if it works now.

halfshoe commented 4 years ago

I think, the solution you proposed is not entirely correct. Reaching the end of the file is normal situation. It will be enough to return the number of bytes read. So maybe dwell on my version? ))

bakape commented 4 years ago

I'll need to look into how FFmpeg handles EOF from read and seek callbacks.

On Mon, 23 Mar 2020 at 17:04, halfshoe notifications@github.com wrote:

I think, the solution you proposed is not entirely correct. Reaching the end of the file is normal situation. It will be enough to return the number of bytes read. So maybe dwell on my version? ))

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bakape/thumbnailer/issues/61#issuecomment-602655998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB347MAYDUJVKVVWZHDCDF3RI53AHANCNFSM4LRYMWIA .

bakape commented 4 years ago

Corrected to comply with io.Reader spec in 835d0de1555a61f4d902dcea5d73c225404e5da2

On Tue, 24 Mar 2020 at 10:52, Janis Petersons bakape@gmail.com wrote:

I'll need to look into how FFmpeg handles EOF from read and seek callbacks.

On Mon, 23 Mar 2020 at 17:04, halfshoe notifications@github.com wrote:

I think, the solution you proposed is not entirely correct. Reaching the end of the file is normal situation. It will be enough to return the number of bytes read. So maybe dwell on my version? ))

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bakape/thumbnailer/issues/61#issuecomment-602655998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB347MAYDUJVKVVWZHDCDF3RI53AHANCNFSM4LRYMWIA .