mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
qtdemux: Use GstClockTime for nanosecond-based time variables/fields
Avoids confusion with timescaled-based variables and bytes (offset) variables. And use GST_CLOCK_TIME_NONE where applicable
This commit is contained in:
parent
0a381b9edd
commit
7828f73516
2 changed files with 64 additions and 57 deletions
|
@ -92,7 +92,7 @@
|
||||||
#define QTDEMUX_SECONDS_FROM_1904_TO_1970 (((1970 - 1904) * (guint64) 365 + \
|
#define QTDEMUX_SECONDS_FROM_1904_TO_1970 (((1970 - 1904) * (guint64) 365 + \
|
||||||
QTDEMUX_LEAP_YEARS_FROM_1904_TO_1970) * QTDEMUX_SECONDS_PER_DAY)
|
QTDEMUX_LEAP_YEARS_FROM_1904_TO_1970) * QTDEMUX_SECONDS_PER_DAY)
|
||||||
|
|
||||||
#define STREAM_IS_EOS(s) (s->time_position == -1)
|
#define STREAM_IS_EOS(s) (s->time_position == GST_CLOCK_TIME_NONE)
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (qtdemux_debug);
|
GST_DEBUG_CATEGORY (qtdemux_debug);
|
||||||
|
|
||||||
|
@ -190,12 +190,12 @@ struct _QtDemuxSample
|
||||||
struct _QtDemuxSegment
|
struct _QtDemuxSegment
|
||||||
{
|
{
|
||||||
/* global time and duration, all gst time */
|
/* global time and duration, all gst time */
|
||||||
guint64 time;
|
GstClockTime time;
|
||||||
guint64 stop_time;
|
GstClockTime stop_time;
|
||||||
guint64 duration;
|
GstClockTime duration;
|
||||||
/* media time of trak, all gst time */
|
/* media time of trak, all gst time */
|
||||||
guint64 media_start;
|
GstClockTime media_start;
|
||||||
guint64 media_stop;
|
GstClockTime media_stop;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
/* Media start time in trak timescale units */
|
/* Media start time in trak timescale units */
|
||||||
guint32 trak_media_start;
|
guint32 trak_media_start;
|
||||||
|
@ -299,7 +299,7 @@ struct _QtDemuxStream
|
||||||
/* current position */
|
/* current position */
|
||||||
guint32 segment_index;
|
guint32 segment_index;
|
||||||
guint32 sample_index;
|
guint32 sample_index;
|
||||||
guint64 time_position; /* in gst time */
|
GstClockTime time_position; /* in gst time */
|
||||||
|
|
||||||
/* the Gst segment we are processing out, used for clipping */
|
/* the Gst segment we are processing out, used for clipping */
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
|
@ -430,7 +430,7 @@ static void gst_qtdemux_dispose (GObject * object);
|
||||||
|
|
||||||
static guint32
|
static guint32
|
||||||
gst_qtdemux_find_index_linear (GstQTDemux * qtdemux, QtDemuxStream * str,
|
gst_qtdemux_find_index_linear (GstQTDemux * qtdemux, QtDemuxStream * str,
|
||||||
guint64 media_time);
|
GstClockTime media_time);
|
||||||
static guint32
|
static guint32
|
||||||
gst_qtdemux_find_index_for_given_media_offset_linear (GstQTDemux * qtdemux,
|
gst_qtdemux_find_index_for_given_media_offset_linear (GstQTDemux * qtdemux,
|
||||||
QtDemuxStream * str, gint64 media_offset);
|
QtDemuxStream * str, gint64 media_offset);
|
||||||
|
@ -732,7 +732,7 @@ done:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_qtdemux_get_duration (GstQTDemux * qtdemux, gint64 * duration)
|
gst_qtdemux_get_duration (GstQTDemux * qtdemux, GstClockTime * duration)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
|
|
||||||
|
@ -777,9 +777,8 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstObject * parent,
|
||||||
/* First try to query upstream */
|
/* First try to query upstream */
|
||||||
res = gst_pad_query_default (pad, parent, query);
|
res = gst_pad_query_default (pad, parent, query);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
gint64 duration = -1;
|
guint64 duration;
|
||||||
gst_qtdemux_get_duration (qtdemux, &duration);
|
if (gst_qtdemux_get_duration (qtdemux, &duration) && duration > 0) {
|
||||||
if (duration > 0) {
|
|
||||||
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -815,7 +814,7 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstObject * parent,
|
||||||
if (!res) {
|
if (!res) {
|
||||||
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
||||||
if (fmt == GST_FORMAT_TIME) {
|
if (fmt == GST_FORMAT_TIME) {
|
||||||
gint64 duration = -1;
|
GstClockTime duration = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
gst_qtdemux_get_duration (qtdemux, &duration);
|
gst_qtdemux_get_duration (qtdemux, &duration);
|
||||||
seekable = TRUE;
|
seekable = TRUE;
|
||||||
|
@ -1028,7 +1027,7 @@ parse_failed:
|
||||||
*/
|
*/
|
||||||
static guint32
|
static guint32
|
||||||
gst_qtdemux_find_index_linear (GstQTDemux * qtdemux, QtDemuxStream * str,
|
gst_qtdemux_find_index_linear (GstQTDemux * qtdemux, QtDemuxStream * str,
|
||||||
guint64 media_time)
|
GstClockTime media_time)
|
||||||
{
|
{
|
||||||
guint32 index = 0;
|
guint32 index = 0;
|
||||||
guint64 mov_time;
|
guint64 mov_time;
|
||||||
|
@ -1116,7 +1115,7 @@ beach:
|
||||||
*/
|
*/
|
||||||
static guint32
|
static guint32
|
||||||
gst_qtdemux_find_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
gst_qtdemux_find_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
guint64 time_position)
|
GstClockTime time_position)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
guint32 seg_idx;
|
guint32 seg_idx;
|
||||||
|
@ -1188,9 +1187,9 @@ gst_qtdemux_adjust_seek (GstQTDemux * qtdemux, gint64 desired_time,
|
||||||
QtDemuxStream *str;
|
QtDemuxStream *str;
|
||||||
guint32 index, kindex;
|
guint32 index, kindex;
|
||||||
guint32 seg_idx;
|
guint32 seg_idx;
|
||||||
guint64 media_start;
|
GstClockTime media_start;
|
||||||
guint64 media_time;
|
GstClockTime media_time;
|
||||||
guint64 seg_time;
|
GstClockTime seg_time;
|
||||||
QtDemuxSegment *seg;
|
QtDemuxSegment *seg;
|
||||||
|
|
||||||
str = qtdemux->streams[n];
|
str = qtdemux->streams[n];
|
||||||
|
@ -1231,7 +1230,7 @@ gst_qtdemux_adjust_seek (GstQTDemux * qtdemux, gint64 desired_time,
|
||||||
* desired_offset. keyframes out of the segment are
|
* desired_offset. keyframes out of the segment are
|
||||||
* ignored. */
|
* ignored. */
|
||||||
if (media_time >= seg->media_start) {
|
if (media_time >= seg->media_start) {
|
||||||
guint64 seg_time;
|
GstClockTime seg_time;
|
||||||
|
|
||||||
/* this keyframe is inside the segment, convert back to
|
/* this keyframe is inside the segment, convert back to
|
||||||
* segment time */
|
* segment time */
|
||||||
|
@ -2356,7 +2355,7 @@ static gboolean
|
||||||
qtdemux_parse_mehd (GstQTDemux * qtdemux, GstByteReader * br)
|
qtdemux_parse_mehd (GstQTDemux * qtdemux, GstByteReader * br)
|
||||||
{
|
{
|
||||||
guint32 version = 0;
|
guint32 version = 0;
|
||||||
guint64 duration = 0;
|
GstClockTime duration = 0;
|
||||||
|
|
||||||
if (!gst_byte_reader_get_uint32_be (br, &version))
|
if (!gst_byte_reader_get_uint32_be (br, &version))
|
||||||
goto failed;
|
goto failed;
|
||||||
|
@ -3343,7 +3342,7 @@ gst_qtdemux_seek_to_previous_keyframe (GstQTDemux * qtdemux)
|
||||||
guint8 n = 0;
|
guint8 n = 0;
|
||||||
guint32 seg_idx = 0, k_index = 0;
|
guint32 seg_idx = 0, k_index = 0;
|
||||||
guint32 ref_seg_idx, ref_k_index;
|
guint32 ref_seg_idx, ref_k_index;
|
||||||
guint64 k_pos = 0, last_stop = 0;
|
GstClockTime k_pos = 0, last_stop = 0;
|
||||||
QtDemuxSegment *seg = NULL;
|
QtDemuxSegment *seg = NULL;
|
||||||
QtDemuxStream *ref_str = NULL;
|
QtDemuxStream *ref_str = NULL;
|
||||||
guint64 seg_media_start_mov; /* segment media start time in mov format */
|
guint64 seg_media_start_mov; /* segment media start time in mov format */
|
||||||
|
@ -3449,7 +3448,7 @@ gst_qtdemux_seek_to_previous_keyframe (GstQTDemux * qtdemux)
|
||||||
/* Align them all on this */
|
/* Align them all on this */
|
||||||
for (n = 0; n < qtdemux->n_streams; n++) {
|
for (n = 0; n < qtdemux->n_streams; n++) {
|
||||||
guint32 index = 0;
|
guint32 index = 0;
|
||||||
guint64 seg_time = 0;
|
GstClockTime seg_time = 0;
|
||||||
QtDemuxStream *str = qtdemux->streams[n];
|
QtDemuxStream *str = qtdemux->streams[n];
|
||||||
|
|
||||||
/* aligning reference stream again might lead to backing up to yet another
|
/* aligning reference stream again might lead to backing up to yet another
|
||||||
|
@ -3516,20 +3515,22 @@ eos:
|
||||||
* This will push out a NEWSEGMENT event with the right values and
|
* This will push out a NEWSEGMENT event with the right values and
|
||||||
* position the stream index to the first decodable sample before
|
* position the stream index to the first decodable sample before
|
||||||
* @offset.
|
* @offset.
|
||||||
|
*
|
||||||
|
* PULL-BASED
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
guint32 seg_idx, guint64 offset)
|
guint32 seg_idx, GstClockTime offset)
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
QtDemuxSegment *segment;
|
QtDemuxSegment *segment;
|
||||||
guint32 index, kf_index;
|
guint32 index, kf_index;
|
||||||
guint64 seg_time;
|
GstClockTime seg_time;
|
||||||
guint64 start, stop, time;
|
GstClockTime start, stop, time;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
|
|
||||||
GST_LOG_OBJECT (qtdemux, "activate segment %d, offset %" G_GUINT64_FORMAT,
|
GST_LOG_OBJECT (qtdemux, "activate segment %d, offset %" GST_TIME_FORMAT,
|
||||||
seg_idx, offset);
|
seg_idx, GST_TIME_ARGS (offset));
|
||||||
|
|
||||||
/* update the current segment */
|
/* update the current segment */
|
||||||
stream->segment_index = seg_idx;
|
stream->segment_index = seg_idx;
|
||||||
|
@ -3538,17 +3539,18 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
segment = &stream->segments[seg_idx];
|
segment = &stream->segments[seg_idx];
|
||||||
|
|
||||||
if (G_UNLIKELY (offset < segment->time)) {
|
if (G_UNLIKELY (offset < segment->time)) {
|
||||||
GST_WARNING_OBJECT (qtdemux, "offset < segment->time %" G_GUINT64_FORMAT,
|
GST_WARNING_OBJECT (qtdemux, "offset < segment->time %" GST_TIME_FORMAT,
|
||||||
segment->time);
|
GST_TIME_ARGS (segment->time));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* segment lies beyond total indicated duration */
|
/* segment lies beyond total indicated duration */
|
||||||
if (G_UNLIKELY (qtdemux->segment.duration != -1 &&
|
if (G_UNLIKELY (qtdemux->segment.duration != GST_CLOCK_TIME_NONE &&
|
||||||
segment->time > qtdemux->segment.duration)) {
|
segment->time > qtdemux->segment.duration)) {
|
||||||
GST_WARNING_OBJECT (qtdemux, "file duration %" G_GINT64_FORMAT
|
GST_WARNING_OBJECT (qtdemux, "file duration %" GST_TIME_FORMAT
|
||||||
" < segment->time %" G_GUINT64_FORMAT, qtdemux->segment.duration,
|
" < segment->time %" GST_TIME_FORMAT,
|
||||||
segment->time);
|
GST_TIME_ARGS (qtdemux->segment.duration),
|
||||||
|
GST_TIME_ARGS (segment->time));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3571,9 +3573,9 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
* into the track-time-realm */
|
* into the track-time-realm */
|
||||||
|
|
||||||
stop = qtdemux->segment.stop;
|
stop = qtdemux->segment.stop;
|
||||||
if (stop == -1)
|
if (stop == GST_CLOCK_TIME_NONE)
|
||||||
stop = qtdemux->segment.duration;
|
stop = qtdemux->segment.duration;
|
||||||
if (stop == -1)
|
if (stop == GST_CLOCK_TIME_NONE)
|
||||||
stop = segment->media_stop;
|
stop = segment->media_stop;
|
||||||
else
|
else
|
||||||
stop =
|
stop =
|
||||||
|
@ -3722,20 +3724,23 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
* This function will also prepare and send the segment when needed.
|
* This function will also prepare and send the segment when needed.
|
||||||
*
|
*
|
||||||
* Return FALSE if the stream is EOS.
|
* Return FALSE if the stream is EOS.
|
||||||
|
*
|
||||||
|
* PULL-BASED
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_qtdemux_prepare_current_sample (GstQTDemux * qtdemux,
|
gst_qtdemux_prepare_current_sample (GstQTDemux * qtdemux,
|
||||||
QtDemuxStream * stream, gboolean * empty, guint64 * offset, guint * size,
|
QtDemuxStream * stream, gboolean * empty, guint64 * offset, guint * size,
|
||||||
guint64 * dts, guint64 * pts, guint64 * duration, gboolean * keyframe)
|
GstClockTime * dts, GstClockTime * pts, GstClockTime * duration,
|
||||||
|
gboolean * keyframe)
|
||||||
{
|
{
|
||||||
QtDemuxSample *sample;
|
QtDemuxSample *sample;
|
||||||
guint64 time_position;
|
GstClockTime time_position;
|
||||||
guint32 seg_idx;
|
guint32 seg_idx;
|
||||||
|
|
||||||
g_return_val_if_fail (stream != NULL, FALSE);
|
g_return_val_if_fail (stream != NULL, FALSE);
|
||||||
|
|
||||||
time_position = stream->time_position;
|
time_position = stream->time_position;
|
||||||
if (G_UNLIKELY (time_position == -1))
|
if (G_UNLIKELY (time_position == GST_CLOCK_TIME_NONE))
|
||||||
goto eos;
|
goto eos;
|
||||||
|
|
||||||
seg_idx = stream->segment_index;
|
seg_idx = stream->segment_index;
|
||||||
|
@ -3810,7 +3815,7 @@ gst_qtdemux_prepare_current_sample (GstQTDemux * qtdemux,
|
||||||
/* special cases */
|
/* special cases */
|
||||||
eos:
|
eos:
|
||||||
{
|
{
|
||||||
stream->time_position = -1;
|
stream->time_position = GST_CLOCK_TIME_NONE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3837,7 +3842,7 @@ gst_qtdemux_advance_sample (GstQTDemux * qtdemux, QtDemuxStream * stream)
|
||||||
/* Mark the stream as EOS */
|
/* Mark the stream as EOS */
|
||||||
GST_DEBUG_OBJECT (qtdemux,
|
GST_DEBUG_OBJECT (qtdemux,
|
||||||
"reached max allowed sample %u, mark EOS", stream->to_sample);
|
"reached max allowed sample %u, mark EOS", stream->to_sample);
|
||||||
stream->time_position = -1;
|
stream->time_position = GST_CLOCK_TIME_NONE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3885,7 +3890,7 @@ next_segment:
|
||||||
|
|
||||||
if (stream->segment_index == stream->n_segments - 1) {
|
if (stream->segment_index == stream->n_segments - 1) {
|
||||||
/* are we at the end of the last segment, we're EOS */
|
/* are we at the end of the last segment, we're EOS */
|
||||||
stream->time_position = -1;
|
stream->time_position = GST_CLOCK_TIME_NONE;
|
||||||
} else {
|
} else {
|
||||||
/* else we're only at the end of the current segment */
|
/* else we're only at the end of the current segment */
|
||||||
stream->time_position = segment->stop_time;
|
stream->time_position = segment->stop_time;
|
||||||
|
@ -4157,8 +4162,8 @@ gst_qtdemux_process_buffer (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux,
|
gst_qtdemux_decorate_and_push_buffer (GstQTDemux * qtdemux,
|
||||||
QtDemuxStream * stream, GstBuffer * buf,
|
QtDemuxStream * stream, GstBuffer * buf,
|
||||||
guint64 dts, guint64 pts, guint64 duration, gboolean keyframe,
|
GstClockTime dts, GstClockTime pts, GstClockTime duration,
|
||||||
guint64 position, guint64 byte_position)
|
gboolean keyframe, GstClockTime position, guint64 byte_position)
|
||||||
{
|
{
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
|
@ -4390,11 +4395,11 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
GstBuffer *buf = NULL;
|
GstBuffer *buf = NULL;
|
||||||
QtDemuxStream *stream;
|
QtDemuxStream *stream;
|
||||||
guint64 min_time;
|
GstClockTime min_time;
|
||||||
guint64 offset = 0;
|
guint64 offset = 0;
|
||||||
guint64 dts = GST_CLOCK_TIME_NONE;
|
GstClockTime dts = GST_CLOCK_TIME_NONE;
|
||||||
guint64 pts = GST_CLOCK_TIME_NONE;
|
GstClockTime pts = GST_CLOCK_TIME_NONE;
|
||||||
guint64 duration = 0;
|
GstClockTime duration = 0;
|
||||||
gboolean keyframe = FALSE;
|
gboolean keyframe = FALSE;
|
||||||
guint sample_size = 0;
|
guint sample_size = 0;
|
||||||
gboolean empty = 0;
|
gboolean empty = 0;
|
||||||
|
@ -4416,13 +4421,13 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
|
||||||
min_time = G_MAXUINT64;
|
min_time = G_MAXUINT64;
|
||||||
index = -1;
|
index = -1;
|
||||||
for (i = 0; i < qtdemux->n_streams; i++) {
|
for (i = 0; i < qtdemux->n_streams; i++) {
|
||||||
guint64 position;
|
GstClockTime position;
|
||||||
|
|
||||||
stream = qtdemux->streams[i];
|
stream = qtdemux->streams[i];
|
||||||
position = stream->time_position;
|
position = stream->time_position;
|
||||||
|
|
||||||
/* position of -1 is EOS */
|
/* position of -1 is EOS */
|
||||||
if (position != -1 && position < min_time) {
|
if (position != GST_CLOCK_TIME_NONE && position < min_time) {
|
||||||
min_time = position;
|
min_time = position;
|
||||||
index = i;
|
index = i;
|
||||||
}
|
}
|
||||||
|
@ -4440,7 +4445,7 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
|
||||||
&& qtdemux->segment.start > min_time))
|
&& qtdemux->segment.start > min_time))
|
||||||
&& qtdemux->streams[index]->on_keyframe)) {
|
&& qtdemux->streams[index]->on_keyframe)) {
|
||||||
GST_DEBUG_OBJECT (qtdemux, "we reached the end of our segment.");
|
GST_DEBUG_OBJECT (qtdemux, "we reached the end of our segment.");
|
||||||
qtdemux->streams[index]->time_position = -1;
|
qtdemux->streams[index]->time_position = GST_CLOCK_TIME_NONE;
|
||||||
goto eos_stream;
|
goto eos_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5207,7 +5212,7 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
|
||||||
QtDemuxStream *stream = NULL;
|
QtDemuxStream *stream = NULL;
|
||||||
QtDemuxSample *sample;
|
QtDemuxSample *sample;
|
||||||
int i = -1;
|
int i = -1;
|
||||||
guint64 dts, pts, duration;
|
GstClockTime dts, pts, duration;
|
||||||
gboolean keyframe;
|
gboolean keyframe;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux,
|
GST_DEBUG_OBJECT (demux,
|
||||||
|
@ -5316,7 +5321,7 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
|
||||||
if (G_UNLIKELY (demux->segment.stop != -1
|
if (G_UNLIKELY (demux->segment.stop != -1
|
||||||
&& demux->segment.stop <= pts && stream->on_keyframe)) {
|
&& demux->segment.stop <= pts && stream->on_keyframe)) {
|
||||||
GST_DEBUG_OBJECT (demux, "we reached the end of our segment.");
|
GST_DEBUG_OBJECT (demux, "we reached the end of our segment.");
|
||||||
stream->time_position = -1; /* this means EOS */
|
stream->time_position = GST_CLOCK_TIME_NONE; /* this means EOS */
|
||||||
|
|
||||||
/* check if all streams are eos */
|
/* check if all streams are eos */
|
||||||
ret = GST_FLOW_EOS;
|
ret = GST_FLOW_EOS;
|
||||||
|
@ -7041,7 +7046,8 @@ qtdemux_parse_segments (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||||
GNode *elst;
|
GNode *elst;
|
||||||
gint n_segments;
|
gint n_segments;
|
||||||
gint i, count;
|
gint i, count;
|
||||||
guint64 time, stime;
|
guint64 time;
|
||||||
|
GstClockTime stime;
|
||||||
guint8 *buffer;
|
guint8 *buffer;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (qtdemux, "looking for edit list");
|
GST_DEBUG_OBJECT (qtdemux, "looking for edit list");
|
||||||
|
@ -7144,7 +7150,7 @@ done:
|
||||||
|
|
||||||
/* represent unknown our way */
|
/* represent unknown our way */
|
||||||
if (stream_duration == 0)
|
if (stream_duration == 0)
|
||||||
stream_duration = -1;
|
stream_duration = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
stream->segments[0].time = 0;
|
stream->segments[0].time = 0;
|
||||||
stream->segments[0].stop_time = stream_duration;
|
stream->segments[0].stop_time = stream_duration;
|
||||||
|
@ -9200,7 +9206,8 @@ static void
|
||||||
gst_qtdemux_guess_bitrate (GstQTDemux * qtdemux)
|
gst_qtdemux_guess_bitrate (GstQTDemux * qtdemux)
|
||||||
{
|
{
|
||||||
QtDemuxStream *stream = NULL;
|
QtDemuxStream *stream = NULL;
|
||||||
gint64 size, duration, sys_bitrate, sum_bitrate = 0;
|
gint64 size, sys_bitrate, sum_bitrate = 0;
|
||||||
|
GstClockTime duration;
|
||||||
gint i;
|
gint i;
|
||||||
guint bitrate;
|
guint bitrate;
|
||||||
|
|
||||||
|
@ -10587,7 +10594,7 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||||
GNode *trak;
|
GNode *trak;
|
||||||
GNode *udta;
|
GNode *udta;
|
||||||
GNode *mvex;
|
GNode *mvex;
|
||||||
gint64 duration;
|
GstClockTime duration;
|
||||||
guint64 creation_time;
|
guint64 creation_time;
|
||||||
GstDateTime *datetime = NULL;
|
GstDateTime *datetime = NULL;
|
||||||
gint version;
|
gint version;
|
||||||
|
|
|
@ -76,7 +76,7 @@ struct _GstQTDemux {
|
||||||
GNode *moov_node_compressed;
|
GNode *moov_node_compressed;
|
||||||
|
|
||||||
guint32 timescale;
|
guint32 timescale;
|
||||||
guint64 duration;
|
GstClockTime duration;
|
||||||
|
|
||||||
gboolean fragmented;
|
gboolean fragmented;
|
||||||
gboolean fragmented_seek_pending;
|
gboolean fragmented_seek_pending;
|
||||||
|
|
Loading…
Reference in a new issue