]> git.sesse.net Git - vlc/blobdiff - modules/mux/mp4.c
mp4: calculate stream duration sameway all around
[vlc] / modules / mux / mp4.c
index 8fde903da377ba0767defd67e7a1b2f1661ee4ec..8af05589ec941cae2c4fd24bee7d339b1cb55896 100644 (file)
@@ -564,7 +564,7 @@ again:
         }
 
         /* update */
-        p_stream->i_duration += p_data->i_length;
+        p_stream->i_duration = p_stream->i_last_dts - p_stream->i_dts_start + p_data->i_length;
         p_sys->i_pos += p_data->i_buffer;
 
         /* Save the DTS */