File: gst-plugins-good-Revert-qtdemux-expose-streams-with-first-moof-for-fr.patch

package info (click to toggle)
qtwebkit-opensource-src 5.212.0~alpha4-30
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 126,360 kB
  • sloc: cpp: 1,399,204; javascript: 111,961; ansic: 29,742; perl: 19,510; python: 13,364; ruby: 10,299; xml: 9,342; asm: 5,078; yacc: 2,166; lex: 906; sh: 417; makefile: 34
file content (133 lines) | stat: -rw-r--r-- 5,541 bytes parent folder | download | duplicates (6)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
From 1a81bd90d4a3e59d6669a0bbfa456f1ed4e5db48 Mon Sep 17 00:00:00 2001
From: Xabier Rodriguez Calvar <calvaris@igalia.com>
Date: Thu, 7 Apr 2016 13:57:16 +0200
Subject: [PATCH] Revert "qtdemux: expose streams with first moof for
 fragmented format"

This reverts commit d8bb6687ea251570c331038279a43d448167d6ad.
---
 gst/isomp4/qtdemux.c | 54 ++++++++++++++++------------------------------------
 gst/isomp4/qtdemux.h |  1 -
 2 files changed, 16 insertions(+), 39 deletions(-)

diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 39be163..9636b4b 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -609,7 +609,6 @@ gst_qtdemux_init (GstQTDemux * qtdemux)
   qtdemux->state = QTDEMUX_STATE_INITIAL;
   qtdemux->pullbased = FALSE;
   qtdemux->posted_redirect = FALSE;
-  qtdemux->pending_configure = FALSE;
   qtdemux->neededbytes = 16;
   qtdemux->todrop = 0;
   qtdemux->adapter = gst_adapter_new ();
@@ -2049,7 +2048,6 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
     gst_caps_replace (&qtdemux->media_caps, NULL);
     qtdemux->timescale = 0;
     qtdemux->got_moov = FALSE;
-    qtdemux->pending_configure = FALSE;
   } else if (qtdemux->mss_mode) {
     gst_flow_combiner_reset (qtdemux->flowcombiner);
     for (n = 0; n < qtdemux->n_streams; n++)
@@ -6104,7 +6102,6 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
             &fourcc);
         if (fourcc == FOURCC_moov) {
           gint n;
-          gboolean got_samples = FALSE;
 
           /* in usual fragmented setup we could try to scan for more
            * and end up at the the moov (after mdat) again */
@@ -6136,27 +6133,19 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
             qtdemux_node_dump (demux, demux->moov_node);
             qtdemux_parse_tree (demux);
             qtdemux_prepare_streams (demux);
+            if (!demux->got_moov)
+              qtdemux_expose_streams (demux);
+            else {
 
-            for (n = 0; n < demux->n_streams; n++) {
-              QtDemuxStream *stream = demux->streams[n];
-              got_samples |= stream->stbl_index >= 0;
-            }
-            if (!demux->fragmented || got_samples) {
-              if (!demux->got_moov) {
-                qtdemux_expose_streams (demux);
-              } else {
-                for (n = 0; n < demux->n_streams; n++) {
-                  QtDemuxStream *stream = demux->streams[n];
-                  gst_qtdemux_configure_stream (demux, stream);
-                }
+              for (n = 0; n < demux->n_streams; n++) {
+                QtDemuxStream *stream = demux->streams[n];
+
+                gst_qtdemux_configure_stream (demux, stream);
               }
-              gst_qtdemux_check_send_pending_segment (demux);
-              demux->pending_configure = FALSE;
-            } else {
-              demux->pending_configure = TRUE;
             }
 
             demux->got_moov = TRUE;
+            gst_qtdemux_check_send_pending_segment (demux);
 
             /* fragmented streams headers shouldn't contain edts atoms */
             if (!demux->fragmented) {
@@ -6175,7 +6164,6 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
             guint64 dist = 0;
             GstClockTime prev_pts;
             guint64 prev_offset;
-            gint n;
 
             GST_DEBUG_OBJECT (demux, "Parsing [moof]");
 
@@ -6209,25 +6197,15 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
               ret = GST_FLOW_ERROR;
               goto done;
             }
-            /* in MSS we need to expose the pads after the first moof as we won't get a moov 
-             * Also, fragmented format need to be exposed if a moov have no valid sample data */
-            if (demux->mss_mode || demux->pending_configure) {
-              if (!demux->exposed) {
-                if (!demux->pending_newsegment) {
-                  GstSegment segment;
-                  gst_segment_init (&segment, GST_FORMAT_TIME);
-                  GST_DEBUG_OBJECT (demux, "new pending_newsegment");
-                  demux->pending_newsegment = gst_event_new_segment (&segment);
-                }
-                qtdemux_expose_streams (demux);
-              } else {
-                for (n = 0; n < demux->n_streams; n++) {
-                  QtDemuxStream *stream = demux->streams[n];
-                  gst_qtdemux_configure_stream (demux, stream);
-                }
+            /* in MSS we need to expose the pads after the first moof as we won't get a moov */
+            if (demux->mss_mode && !demux->exposed) {
+              if (!demux->pending_newsegment) {
+                GstSegment segment;
+                gst_segment_init (&segment, GST_FORMAT_TIME);
+                GST_DEBUG_OBJECT (demux, "new pending_newsegment");
+                demux->pending_newsegment = gst_event_new_segment (&segment);
               }
-              gst_qtdemux_check_send_pending_segment (demux);
-              demux->pending_configure = FALSE;
+              qtdemux_expose_streams (demux);
             }
           } else {
             GST_DEBUG_OBJECT (demux, "Discarding [moof]");
diff --git a/gst/isomp4/qtdemux.h b/gst/isomp4/qtdemux.h
index 6061215..ecf0c63 100644
--- a/gst/isomp4/qtdemux.h
+++ b/gst/isomp4/qtdemux.h
@@ -89,7 +89,6 @@ struct _GstQTDemux {
   gboolean posted_redirect;
 
   /* push based variables */
-  gboolean pending_configure;
   guint neededbytes;
   guint todrop;
   GstAdapter *adapter;
-- 
2.8.0.rc3