@@ -228,8 +228,8 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s)
228
228
ngx_rtmp_dash_app_conf_t * dacf ;
229
229
230
230
static u_char buffer [NGX_RTMP_DASH_BUFSIZE ];
231
- static u_char start_time [sizeof ("1970-09-28T12:00:00+06:00 " )];
232
- static u_char end_time [sizeof ("1970-09-28T12:00:00+06:00 " )];
231
+ static u_char start_time [sizeof ("1970-09-28T12:00:00Z " )];
232
+ static u_char pub_time [sizeof ("1970-09-28T12:00:00Z " )];
233
233
234
234
dacf = ngx_rtmp_get_module_app_conf (s , ngx_rtmp_dash_module );
235
235
ctx = ngx_rtmp_get_module_ctx (s , ngx_rtmp_dash_module );
@@ -259,11 +259,10 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s)
259
259
" type=\"dynamic\"\n" \
260
260
" xmlns=\"urn:mpeg:dash:schema:mpd:2011\"\n" \
261
261
" availabilityStartTime=\"%s\"\n" \
262
- " availabilityEndTime =\"%s\"\n" \
262
+ " publishTime =\"%s\"\n" \
263
263
" minimumUpdatePeriod=\"PT%uiS\"\n" \
264
264
" minBufferTime=\"PT%uiS\"\n" \
265
- " timeShiftBufferDepth=\"PT0H0M0.00S\"\n" \
266
- " suggestedPresentationDelay=\"PT%uiS\"\n" \
265
+ " timeShiftBufferDepth=\"PT%uiS\"\n" \
267
266
" profiles=\"urn:hbbtv:dash:profile:isoff-live:2012," \
268
267
"urn:mpeg:dash:profile:isoff-live:2011\"\n" \
269
268
" xmlns:xsi=\"http://www.w3.org/2011/XMLSchema-instance\"\n" \
@@ -285,11 +284,9 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s)
285
284
" width=\"%ui\"\n" \
286
285
" height=\"%ui\"\n" \
287
286
" frameRate=\"%ui\"\n" \
288
- " sar=\"1:1\"\n" \
289
287
" startWithSAP=\"1\"\n" \
290
288
" bandwidth=\"%ui\">\n" \
291
289
" <SegmentTemplate\n" \
292
- " presentationTimeOffset=\"0\"\n" \
293
290
" timescale=\"1000\"\n" \
294
291
" media=\"%V%s$Time$.m4v\"\n" \
295
292
" initialization=\"%V%sinit.m4v\">\n" \
@@ -323,7 +320,6 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s)
323
320
" startWithSAP=\"1\"\n" \
324
321
" bandwidth=\"%ui\">\n" \
325
322
" <SegmentTemplate\n" \
326
- " presentationTimeOffset=\"0\"\n" \
327
323
" timescale=\"1000\"\n" \
328
324
" media=\"%V%s$Time$.m4a\"\n" \
329
325
" initialization=\"%V%sinit.m4a\">\n" \
@@ -341,38 +337,28 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s)
341
337
" </Period>\n" \
342
338
"</MPD>\n"
343
339
344
- ngx_libc_localtime (ctx -> start_time .sec +
345
- ngx_rtmp_dash_get_frag (s , 0 )-> timestamp / 1000 , & tm );
346
-
347
- * ngx_sprintf (start_time , "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d" ,
348
- tm .tm_year + 1900 , tm .tm_mon + 1 ,
349
- tm .tm_mday , tm .tm_hour ,
350
- tm .tm_min , tm .tm_sec ,
351
- ctx -> start_time .gmtoff < 0 ? '-' : '+' ,
352
- ngx_abs (ctx -> start_time .gmtoff / 60 ),
353
- ngx_abs (ctx -> start_time .gmtoff % 60 )) = 0 ;
354
-
355
- ngx_libc_localtime (ctx -> start_time .sec +
356
- (ngx_rtmp_dash_get_frag (s , ctx -> nfrags - 1 )-> timestamp +
357
- ngx_rtmp_dash_get_frag (s , ctx -> nfrags - 1 )-> duration ) /
358
- 1000 , & tm );
359
-
360
- * ngx_sprintf (end_time , "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d" ,
361
- tm .tm_year + 1900 , tm .tm_mon + 1 ,
362
- tm .tm_mday , tm .tm_hour ,
363
- tm .tm_min , tm .tm_sec ,
364
- ctx -> start_time .gmtoff < 0 ? '-' : '+' ,
365
- ngx_abs (ctx -> start_time .gmtoff / 60 ),
366
- ngx_abs (ctx -> start_time .gmtoff % 60 )) = 0 ;
340
+ ngx_libc_gmtime (ctx -> start_time .sec / 1000 , & tm );
341
+
342
+ ngx_sprintf (start_time , "%4d-%02d-%02dT%02d:%02d:%02dZ%Z" ,
343
+ tm .tm_year + 1900 , tm .tm_mon + 1 ,
344
+ tm .tm_mday , tm .tm_hour ,
345
+ tm .tm_min , tm .tm_sec );
346
+
347
+ ngx_libc_gmtime (ngx_time (), & tm );
348
+
349
+ ngx_sprintf (pub_time , "%4d-%02d-%02dT%02d:%02d:%02dZ%Z" ,
350
+ tm .tm_year + 1900 , tm .tm_mon + 1 ,
351
+ tm .tm_mday , tm .tm_hour ,
352
+ tm .tm_min , tm .tm_sec );
367
353
368
354
last = buffer + sizeof (buffer );
369
355
370
356
p = ngx_slprintf (buffer , last , NGX_RTMP_DASH_MANIFEST_HEADER ,
371
357
start_time ,
372
- end_time ,
373
- (ngx_uint_t ) (dacf -> fraglen / 1000 ),
358
+ pub_time ,
374
359
(ngx_uint_t ) (dacf -> fraglen / 1000 ),
375
- (ngx_uint_t ) (dacf -> fraglen / 500 ));
360
+ (ngx_uint_t ) (dacf -> fraglen / 500 ),
361
+ (ngx_uint_t ) (dacf -> playlen / 1000 ));
376
362
377
363
n = ngx_write_fd (fd , buffer , p - buffer );
378
364
0 commit comments