[nginx] svn commit: r4689 - trunk/src/http/modules

mdounin at mdounin.ru mdounin at mdounin.ru
Mon Jun 18 14:02:20 UTC 2012


Author: mdounin
Date: 2012-06-18 14:02:20 +0000 (Mon, 18 Jun 2012)
New Revision: 4689
URL: http://trac.nginx.org/nginx/changeset/4689/nginx

Log:
Mp4: fixed streaming if moov atom is at buffer edge.


Modified:
   trunk/src/http/modules/ngx_http_mp4_module.c

Modified: trunk/src/http/modules/ngx_http_mp4_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_mp4_module.c	2012-06-18 14:01:18 UTC (rev 4688)
+++ trunk/src/http/modules/ngx_http_mp4_module.c	2012-06-18 14:02:20 UTC (rev 4689)
@@ -1024,6 +1024,10 @@
                          + NGX_HTTP_MP4_MOOV_BUFFER_EXCESS * no_mdat;
     }
 
+    if (ngx_http_mp4_read(mp4, atom_data_size) != NGX_OK) {
+        return NGX_ERROR;
+    }
+
     mp4->trak.elts = &mp4->traks;
     mp4->trak.size = sizeof(ngx_http_mp4_trak_t);
     mp4->trak.nalloc = 2;
@@ -1044,6 +1048,12 @@
         mp4->buffer_start = mp4->buffer_pos;
         mp4->buffer_size = NGX_HTTP_MP4_MOOV_BUFFER_EXCESS;
 
+        if (mp4->buffer_start + mp4->buffer_size > mp4->buffer_end) {
+            mp4->buffer = NULL;
+            mp4->buffer_pos = NULL;
+            mp4->buffer_end = NULL;
+        }
+
     } else {
         /* skip atoms after moov atom */
         mp4->offset = mp4->end;



More information about the nginx-devel mailing list