blob: ec7171c037e9219404b28cf3661fe3738f71f09f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
From 89655fc3d8aa16d4caa7352e36d3f643090308f8 Mon Sep 17 00:00:00 2001
From: Rob Clark <rob@ti.com>
Date: Sun, 14 Feb 2010 16:11:25 -0600
Subject: [PATCH 2/5] fixes to mux h264 stream utilizing ctts
---
gst/qtmux/gstqtmux.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c
index 1477db7..c6b164b 100644
--- a/gst/qtmux/gstqtmux.c
+++ b/gst/qtmux/gstqtmux.c
@@ -2221,7 +2221,12 @@ again:
} else {
nsamples = 1;
sample_size = GST_BUFFER_SIZE (last_buf);
- if (pad->have_dts) {
+ /* note: by default offset_end will be 0, but qtdemux (and perhaps
+ * others) sets this to -1. So treat either as invalid values.
+ */
+ if (pad->have_dts &&
+ (GST_BUFFER_OFFSET_END (last_buf) != -1) &&
+ (GST_BUFFER_OFFSET_END (last_buf) != 0)) {
gint64 scaled_dts;
pad->last_dts = GST_BUFFER_OFFSET_END (last_buf);
if ((gint64) (pad->last_dts) < 0) {
@@ -2939,6 +2944,7 @@ gst_qt_mux_video_sink_set_caps (GstPad * pad, GstCaps * caps)
}
} else if (strcmp (mimetype, "video/x-h264") == 0) {
entry.fourcc = FOURCC_avc1;
+ qtpad->have_dts = TRUE;
if (qtpad->avg_bitrate == 0) {
gint avg_bitrate = 0;
gst_structure_get_int (structure, "bitrate", &avg_bitrate);
--
1.7.0.4
|