mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gst/qtdemux/qtdemux.c: More coherent framerate setting on caps.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header), (gst_qtdemux_add_stream), (qtdemux_parse_trak): More coherent framerate setting on caps. If sample_size is available, use that for the samples' duration in the index. This enables single frame streams to work (and I imagine fixes some other cases). Tested on testsuite, no regression.
This commit is contained in:
parent
593a09066d
commit
98acdd1dc3
1 changed files with 9 additions and 5 deletions
|
@ -644,8 +644,7 @@ gst_qtdemux_loop_header (GstPad * pad)
|
||||||
|
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
GST_LOG_OBJECT (qtdemux, "reading %d bytes @ " G_GINT64_FORMAT,
|
GST_LOG_OBJECT (qtdemux, "reading %d bytes @ %lld", size, offset);
|
||||||
size, offset);
|
|
||||||
|
|
||||||
if (gst_pad_pull_range (qtdemux->sinkpad, offset,
|
if (gst_pad_pull_range (qtdemux->sinkpad, offset,
|
||||||
size, &buf) != GST_FLOW_OK)
|
size, &buf) != GST_FLOW_OK)
|
||||||
|
@ -744,12 +743,15 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux,
|
||||||
stream->pad = gst_pad_new_from_template (templ, name);
|
stream->pad = gst_pad_new_from_template (templ, name);
|
||||||
gst_object_unref (templ);
|
gst_object_unref (templ);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
if (stream->samples[0].duration == 0) {
|
if ((stream->n_samples == 1) && (stream->samples[0].duration == 0)) {
|
||||||
stream->fps_n = 0;
|
stream->fps_n = 0;
|
||||||
stream->fps_d = 1;
|
stream->fps_d = 1;
|
||||||
} else {
|
} else {
|
||||||
stream->fps_n = stream->timescale;
|
stream->fps_n = stream->timescale;
|
||||||
stream->fps_d = stream->samples[0].duration;
|
if (stream->samples[0].duration == 0)
|
||||||
|
stream->fps_d = 1;
|
||||||
|
else
|
||||||
|
stream->fps_d = stream->samples[0].duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream->caps) {
|
if (stream->caps) {
|
||||||
|
@ -2336,8 +2338,10 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||||
samples[j].size =
|
samples[j].size =
|
||||||
samples_per_chunk * stream->bytes_per_frame /
|
samples_per_chunk * stream->bytes_per_frame /
|
||||||
stream->samples_per_packet / stream->compression;
|
stream->samples_per_packet / stream->compression;
|
||||||
else
|
else if (stream->bytes_per_frame)
|
||||||
samples[j].size = stream->bytes_per_frame;
|
samples[j].size = stream->bytes_per_frame;
|
||||||
|
else
|
||||||
|
samples[j].size = sample_size;
|
||||||
samples[j].duration =
|
samples[j].duration =
|
||||||
samples_per_chunk * stream->timescale / (stream->rate / 2);
|
samples_per_chunk * stream->timescale / (stream->rate / 2);
|
||||||
samples[j].timestamp = timestamp;
|
samples[j].timestamp = timestamp;
|
||||||
|
|
Loading…
Reference in a new issue