-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Fix bug for HTTP, failed to download large file recorded with 2GB #2780 #2781
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,7 +137,7 @@ srs_error_t SrsVodStream::serve_flv_stream(ISrsHttpResponseWriter* w, ISrsHttpMe | |
return err; | ||
} | ||
|
||
srs_error_t SrsVodStream::serve_mp4_stream(ISrsHttpResponseWriter* w, ISrsHttpMessage* r, string fullpath, int start, int end) | ||
srs_error_t SrsVodStream::serve_mp4_stream(ISrsHttpResponseWriter* w, ISrsHttpMessage* r, string fullpath, int start, long end) | ||
{ | ||
srs_error_t err = srs_success; | ||
|
||
|
@@ -154,7 +154,7 @@ srs_error_t SrsVodStream::serve_mp4_stream(ISrsHttpResponseWriter* w, ISrsHttpMe | |
|
||
// parse -1 to whole file. | ||
if (end == -1) { | ||
end = (int)(fs->filesize() - 1); | ||
end = fs->filesize() - 1; | ||
} | ||
|
||
if (end > fs->filesize() || start > end || end < 0) { | ||
|
@@ -180,8 +180,8 @@ srs_error_t SrsVodStream::serve_mp4_stream(ISrsHttpResponseWriter* w, ISrsHttpMe | |
fs->seek2(start); | ||
|
||
// send data | ||
if ((err = copy(w, fs, r, (int)left)) != srs_success) { | ||
return srs_error_wrap(err, "read mp4=%s size=%d", fullpath.c_str(), (int)left); | ||
if ((err = copy(w, fs, r, left)) != srs_success) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If only the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please create a new PR? @CodeflowSun mentioned that he works with Java, so it may not be suitable for him to continue modifying the C++ code. Please make sure to maintain the markdown structure. @CodeflowSun has already identified the problem, which is already very good. Please make sure to maintain the markdown structure. Thank you very much to both of you. 🙏 Please make sure to maintain the markdown structure.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I will create a new PR to address this issue. Thanks to @CodeflowSun for helping to identify the problem 🙏.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When modifying the distribution of mp4 files, it was discovered that flv files also have this issue.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Phenomenon 2, when dragging to play flv, does not support the range parameter. Is it necessary? When distributing flv files using nginx, it supports range operation.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, I would like to ask if the drag-and-drop feature for FLV files has been resolved?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I compiled nginx with the following configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module.
|
||
return srs_error_wrap(err, "read mp4=%s size=%" PRId64 , fullpath.c_str(), left); | ||
} | ||
|
||
return err; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is more appropriate to use int64_t instead of long.
TRANS_BY_GPT3