mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
qtmux: Set timescale of closedcaption tracks to the one of the main video track
This commit is contained in:
parent
0adac97e1c
commit
830e7dc14b
1 changed files with 8 additions and 4 deletions
|
@ -3041,10 +3041,11 @@ gst_qt_mux_start_file (GstQTMux * qtmux)
|
||||||
qtmux->timescale = suggested_timescale;
|
qtmux->timescale = suggested_timescale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set width/height of any closed caption tracks to that of the first
|
/* Set width/height/timescale of any closed caption tracks to that of the
|
||||||
* video track */
|
* first video track */
|
||||||
{
|
{
|
||||||
guint video_width = 0, video_height = 0;
|
guint video_width = 0, video_height = 0;
|
||||||
|
guint32 video_timescale = 0;
|
||||||
GSList *walk;
|
GSList *walk;
|
||||||
|
|
||||||
for (walk = qtmux->sinkpads; walk; walk = g_slist_next (walk)) {
|
for (walk = qtmux->sinkpads; walk; walk = g_slist_next (walk)) {
|
||||||
|
@ -3058,7 +3059,7 @@ gst_qt_mux_start_file (GstQTMux * qtmux)
|
||||||
if (qpad->trak->mdia.hdlr.handler_type != FOURCC_clcp)
|
if (qpad->trak->mdia.hdlr.handler_type != FOURCC_clcp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (video_width == 0 || video_height == 0) {
|
if (video_width == 0 || video_height == 0 || video_timescale == 0) {
|
||||||
GSList *walk2;
|
GSList *walk2;
|
||||||
|
|
||||||
for (walk2 = qtmux->sinkpads; walk2; walk2 = g_slist_next (walk2)) {
|
for (walk2 = qtmux->sinkpads; walk2; walk2 = g_slist_next (walk2)) {
|
||||||
|
@ -3074,11 +3075,13 @@ gst_qt_mux_start_file (GstQTMux * qtmux)
|
||||||
|
|
||||||
video_width = qpad2->trak->tkhd.width;
|
video_width = qpad2->trak->tkhd.width;
|
||||||
video_height = qpad2->trak->tkhd.height;
|
video_height = qpad2->trak->tkhd.height;
|
||||||
|
video_timescale = qpad2->trak->mdia.mdhd.time_info.timescale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qpad->trak->tkhd.width = video_width << 16;
|
qpad->trak->tkhd.width = video_width << 16;
|
||||||
qpad->trak->tkhd.height = video_height << 16;
|
qpad->trak->tkhd.height = video_height << 16;
|
||||||
|
qpad->trak->mdia.mdhd.time_info.timescale = video_timescale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6113,7 +6116,8 @@ gst_qt_mux_caption_sink_set_caps (GstQTPad * qtpad, GstCaps * caps)
|
||||||
} else
|
} else
|
||||||
goto refuse_caps;
|
goto refuse_caps;
|
||||||
|
|
||||||
/* FIXME: Get the timescale from the video track ? */
|
/* We set the real timescale later to the one from the video track when
|
||||||
|
* writing the headers */
|
||||||
timescale = gst_qt_mux_pad_get_timescale (GST_QT_MUX_PAD_CAST (pad));
|
timescale = gst_qt_mux_pad_get_timescale (GST_QT_MUX_PAD_CAST (pad));
|
||||||
if (!timescale && qtmux->trak_timescale)
|
if (!timescale && qtmux->trak_timescale)
|
||||||
timescale = qtmux->trak_timescale;
|
timescale = qtmux->trak_timescale;
|
||||||
|
|
Loading…
Reference in a new issue