-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6505.diff
132 lines (128 loc) · 5.27 KB
/
6505.diff
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
diff --git a/subprojects/gst-libav/ext/libav/gstavdemux.c b/subprojects/gst-libav/ext/libav/gstavdemux.c
index ab6ac1b5c94489afd36e686b89ecd104af400f31..f07e7d3ffdf1d4efa8a3d8779687e53f233fc7ab 100644
--- gst-libav/ext/libav/gstavdemux.c
+++ gst-libav/ext/libav/gstavdemux.c
@@ -1372,63 +1372,6 @@ beach:
}
}
-#define GST_FFMPEG_TYPE_FIND_SIZE 4096
-#define GST_FFMPEG_TYPE_FIND_MIN_SIZE 256
-
-static void
-gst_ffmpegdemux_type_find (GstTypeFind * tf, gpointer priv)
-{
- const guint8 *data;
- AVInputFormat *in_plugin = (AVInputFormat *) priv;
- gint res = 0;
- guint64 length;
- GstCaps *sinkcaps;
-
- /* We want GST_FFMPEG_TYPE_FIND_SIZE bytes, but if the file is shorter than
- * that we'll give it a try... */
- length = gst_type_find_get_length (tf);
- if (length == 0 || length > GST_FFMPEG_TYPE_FIND_SIZE)
- length = GST_FFMPEG_TYPE_FIND_SIZE;
-
- /* The ffmpeg typefinders assume there's a certain minimum amount of data
- * and will happily do invalid memory access if there isn't, so let's just
- * skip the ffmpeg typefinders if the data available is too short
- * (in which case it's unlikely to be a media file anyway) */
- if (length < GST_FFMPEG_TYPE_FIND_MIN_SIZE) {
- GST_LOG ("not typefinding %" G_GUINT64_FORMAT " bytes, too short", length);
- return;
- }
-
- GST_LOG ("typefinding %" G_GUINT64_FORMAT " bytes", length);
- if (in_plugin->read_probe &&
- (data = gst_type_find_peek (tf, 0, length)) != NULL) {
- AVProbeData probe_data;
-
- probe_data.filename = "";
- probe_data.buf = (guint8 *) data;
- probe_data.buf_size = length;
-
- res = in_plugin->read_probe (&probe_data);
- if (res > 0) {
- res = MAX (1, res * GST_TYPE_FIND_MAXIMUM / AVPROBE_SCORE_MAX);
- /* Restrict the probability for MPEG-TS streams, because there is
- * probably a better version in plugins-base, if the user has a recent
- * plugins-base (in fact we shouldn't even get here for ffmpeg mpegts or
- * mpegtsraw typefinders, since we blacklist them) */
- if (g_str_has_prefix (in_plugin->name, "mpegts"))
- res = MIN (res, GST_TYPE_FIND_POSSIBLE);
-
- sinkcaps = gst_ffmpeg_formatid_to_caps (in_plugin->name);
-
- GST_LOG ("libav typefinder '%s' suggests %" GST_PTR_FORMAT ", p=%u%%",
- in_plugin->name, sinkcaps, res);
-
- gst_type_find_suggest (tf, res, sinkcaps);
- gst_caps_unref (sinkcaps);
- }
- }
-}
-
/* Task */
static void
gst_ffmpegdemux_loop (GstFFMpegDemux * demux)
@@ -2055,7 +1998,6 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
while ((in_plugin = av_demuxer_iterate (&i))) {
gchar *type_name, *typefind_name;
gint rank;
- gboolean register_typefind_func = TRUE;
GST_LOG ("Attempting to handle libav demuxer plugin %s [%s]",
in_plugin->name, in_plugin->long_name);
@@ -2102,42 +2044,6 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
!strcmp (in_plugin->name, "ffmetadata"))
continue;
- /* Don't use the typefind functions of formats for which we already have
- * better typefind functions */
- if (!strcmp (in_plugin->name, "mov,mp4,m4a,3gp,3g2,mj2") ||
- !strcmp (in_plugin->name, "ass") ||
- !strcmp (in_plugin->name, "avi") ||
- !strcmp (in_plugin->name, "asf") ||
- !strcmp (in_plugin->name, "mpegvideo") ||
- !strcmp (in_plugin->name, "mp3") ||
- !strcmp (in_plugin->name, "matroska") ||
- !strcmp (in_plugin->name, "matroska_webm") ||
- !strcmp (in_plugin->name, "matroska,webm") ||
- !strcmp (in_plugin->name, "mpeg") ||
- !strcmp (in_plugin->name, "wav") ||
- !strcmp (in_plugin->name, "au") ||
- !strcmp (in_plugin->name, "tta") ||
- !strcmp (in_plugin->name, "rm") ||
- !strcmp (in_plugin->name, "amr") ||
- !strcmp (in_plugin->name, "ogg") ||
- !strcmp (in_plugin->name, "aiff") ||
- !strcmp (in_plugin->name, "ape") ||
- !strcmp (in_plugin->name, "dv") ||
- !strcmp (in_plugin->name, "flv") ||
- !strcmp (in_plugin->name, "mpc") ||
- !strcmp (in_plugin->name, "mpc8") ||
- !strcmp (in_plugin->name, "mpegts") ||
- !strcmp (in_plugin->name, "mpegtsraw") ||
- !strcmp (in_plugin->name, "mxf") ||
- !strcmp (in_plugin->name, "nuv") ||
- !strcmp (in_plugin->name, "swf") ||
- !strcmp (in_plugin->name, "voc") ||
- !strcmp (in_plugin->name, "pva") ||
- !strcmp (in_plugin->name, "gif") ||
- !strcmp (in_plugin->name, "vc1test") ||
- !strcmp (in_plugin->name, "ivf"))
- register_typefind_func = FALSE;
-
/* Set the rank of demuxers known to work to MARGINAL.
* Set demuxers for which we already have another implementation to NONE
* Set All others to NONE*/
@@ -2214,11 +2120,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
else
extensions = NULL;
- if (!gst_element_register (plugin, type_name, rank, type) ||
- (register_typefind_func == TRUE &&
- !gst_type_find_register (plugin, typefind_name, rank,
- gst_ffmpegdemux_type_find, extensions, NULL,
- (gpointer) in_plugin, NULL))) {
+ if (!gst_element_register (plugin, type_name, rank, type)) {
g_warning ("Registration of type %s failed", type_name);
g_free (type_name);
g_free (typefind_name);