Search
j0ke.net Open Build Service
>
Projects
>
Apache
:
Modules
>
apache2-mod_flvx
> mod_flvx-bodera.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File mod_flvx-bodera.patch of Package apache2-mod_flvx
--- mod_flvx.c 2007-03-08 03:08:06.000000000 +0100 +++ mod_flvx.c.1 2009-02-04 18:23:13.000000000 +0100 @@ -13,6 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * + * Modified on 4.II.2008 by Artur Bodera (artur@bodera.com) + * - added offset reset if invalid + * - fixed content-length header generation + * - added last-modified header + * - inspiration: http://apachedev.ru/2006/07/13/mod_flvx-peredacha-potokovogo-flash-video + * + * Usage: + * 1. Compile and install with apxs tool: + * apxs -c -i ./mod_flvx.c + * + * (http://httpd.apache.org/docs/2.0/programs/apxs.html) + * + * 2. Add the following lines to your httpd.conf or create a + * dedicated /etc/httpd/conf.d/mod_flvx.conf config file: + * + * LoadModule flvx_module modules/mod_flvx.so + * AddHandler flv-stream .flv + * + * 3. Restart Apache! + * + * 4. Now your flv files can be streamed using ?start= parameter + * */ #include "httpd.h" @@ -79,6 +102,9 @@ } else { length = fi.size; + + /* Offset should be reset if invalid (mod by Artur Bodera (artur@bodera.com) */ + offset = 0; } bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); @@ -95,7 +121,13 @@ apr_brigade_insert_file(bb, fp, offset, length, r->pool); ap_set_content_type(r, "video/x-flv"); - ap_set_content_length(r, length); + + /* Content length should include FLV header (mod by Artur Bodera (artur@bodera.com) */ + ap_set_content_length(r, length + FLVX_HEADER_LEN); + + /* Add last-modified headers (mod by Artur Bodera (artur@bodera.com) */ + ap_update_mtime(r, r->finfo.mtime); + ap_set_last_modified(r); return ap_pass_brigade(r->output_filters, bb); }