mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
qtdemux: fix buggy duration in edits with duration=0 in fragmented files without a mehd
https://bugzilla.gnome.org/show_bug.cgi?id=794858
This commit is contained in:
parent
db688c5504
commit
ee78825eae
1 changed files with 11 additions and 11 deletions
|
@ -9476,21 +9476,20 @@ qtdemux_parse_segments (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
|||
|
||||
/* time and duration expressed in global timescale */
|
||||
segment->time = stime;
|
||||
/* add non scaled values so we don't cause roundoff errors */
|
||||
if (duration || media_start == GST_CLOCK_TIME_NONE) {
|
||||
if (duration != 0 || empty_edit) {
|
||||
/* edge case: empty edits with duration=zero are treated here.
|
||||
* (files should not have these anyway). */
|
||||
|
||||
/* add non scaled values so we don't cause roundoff errors */
|
||||
time += duration;
|
||||
stime = QTTIME_TO_GSTTIME (qtdemux, time);
|
||||
segment->duration = stime - segment->time;
|
||||
} else {
|
||||
/* zero duration does not imply media_start == media_stop
|
||||
* but, only specify media_start.*/
|
||||
stime = QTTIME_TO_GSTTIME (qtdemux, qtdemux->duration);
|
||||
if (GST_CLOCK_TIME_IS_VALID (stime) && !empty_edit
|
||||
&& stime >= media_start) {
|
||||
segment->duration = stime - media_start;
|
||||
} else {
|
||||
segment->duration = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
* but, only specify media_start. The edit ends with the track. */
|
||||
stime = segment->duration = GST_CLOCK_TIME_NONE;
|
||||
/* Don't allow more edits after this one. */
|
||||
n_segments = segment_number + 1;
|
||||
}
|
||||
segment->stop_time = stime;
|
||||
|
||||
|
@ -9498,7 +9497,8 @@ qtdemux_parse_segments (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
|||
/* media_time expressed in stream timescale */
|
||||
if (!empty_edit) {
|
||||
segment->media_start = media_start;
|
||||
segment->media_stop = segment->media_start + segment->duration;
|
||||
segment->media_stop = GST_CLOCK_TIME_IS_VALID (segment->duration)
|
||||
? segment->media_start + segment->duration : GST_CLOCK_TIME_NONE;
|
||||
media_segments_count++;
|
||||
} else {
|
||||
segment->media_start = GST_CLOCK_TIME_NONE;
|
||||
|
|
Loading…
Reference in a new issue