mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
gst/qtdemux/qtdemux.c: Handle unbounded length streams a bit better. Fixes #367696.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_get_duration), (gst_qtdemux_handle_src_query), (qtdemux_parse_tree), (qtdemux_parse_trak): Handle unbounded length streams a bit better. Fixes #367696.
This commit is contained in:
parent
bd2497729e
commit
4bef7791d9
2 changed files with 31 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-10-31 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* gst/qtdemux/qtdemux.c: (gst_qtdemux_get_duration),
|
||||||
|
(gst_qtdemux_handle_src_query), (qtdemux_parse_tree),
|
||||||
|
(qtdemux_parse_trak):
|
||||||
|
Handle unbounded length streams a bit better. Fixes #367696.
|
||||||
|
|
||||||
2006-10-29 Tim-Philipp Müller <tim at centricular dot net>
|
2006-10-29 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* ext/dts/gstdtsdec.c: (gst_dtsdec_handle_frame):
|
* ext/dts/gstdtsdec.c: (gst_dtsdec_handle_frame):
|
||||||
|
|
|
@ -557,6 +557,22 @@ gst_qtdemux_get_src_query_types (GstPad * pad)
|
||||||
return src_types;
|
return src_types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_qtdemux_get_duration (GstQTDemux * qtdemux, gint64 * duration)
|
||||||
|
{
|
||||||
|
gboolean res = TRUE;
|
||||||
|
|
||||||
|
*duration = GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
|
if (qtdemux->duration != 0) {
|
||||||
|
if (qtdemux->duration != G_MAXINT32 && qtdemux->timescale != 0) {
|
||||||
|
*duration = gst_util_uint64_scale_int (qtdemux->duration,
|
||||||
|
GST_SECOND, qtdemux->timescale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_qtdemux_handle_src_query (GstPad * pad, GstQuery * query)
|
gst_qtdemux_handle_src_query (GstPad * pad, GstQuery * query)
|
||||||
{
|
{
|
||||||
|
@ -572,15 +588,13 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstQuery * query)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_QUERY_DURATION:
|
case GST_QUERY_DURATION:
|
||||||
if (qtdemux->duration != 0 && qtdemux->timescale != 0) {
|
{
|
||||||
gint64 duration;
|
gint64 duration;
|
||||||
|
|
||||||
duration = gst_util_uint64_scale_int (qtdemux->duration,
|
res = gst_qtdemux_get_duration (qtdemux, &duration);
|
||||||
GST_SECOND, qtdemux->timescale);
|
|
||||||
|
|
||||||
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
||||||
res = TRUE;
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
@ -3145,12 +3159,10 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||||
GST_INFO_OBJECT (qtdemux, "timescale: %d", qtdemux->timescale);
|
GST_INFO_OBJECT (qtdemux, "timescale: %d", qtdemux->timescale);
|
||||||
GST_INFO_OBJECT (qtdemux, "duration: %d", qtdemux->duration);
|
GST_INFO_OBJECT (qtdemux, "duration: %d", qtdemux->duration);
|
||||||
|
|
||||||
if (qtdemux->timescale != 0 && qtdemux->duration != 0) {
|
if (TRUE) {
|
||||||
gint64 duration;
|
gint64 duration;
|
||||||
|
|
||||||
duration = gst_util_uint64_scale_int (qtdemux->duration,
|
gst_qtdemux_get_duration (qtdemux, &duration);
|
||||||
GST_SECOND, qtdemux->timescale);
|
|
||||||
|
|
||||||
gst_segment_set_duration (&qtdemux->segment, GST_FORMAT_TIME, duration);
|
gst_segment_set_duration (&qtdemux->segment, GST_FORMAT_TIME, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3242,7 +3254,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
GST_LOG ("track timescale: %d", stream->timescale);
|
GST_LOG ("track timescale: %d", stream->timescale);
|
||||||
GST_LOG ("track duration: %d", stream->duration);
|
GST_LOG ("track duration: %d", stream->duration);
|
||||||
|
|
||||||
{
|
if (qtdemux->duration != G_MAXINT32 && stream->duration != G_MAXINT32) {
|
||||||
guint64 tdur1, tdur2;
|
guint64 tdur1, tdur2;
|
||||||
|
|
||||||
/* don't overflow */
|
/* don't overflow */
|
||||||
|
|
Loading…
Reference in a new issue