summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2007-04-20 10:51:37 +0000
committerMichael Smith <msmith@xiph.org>2007-04-20 10:51:37 +0000
commit357aa01ac655fa64121f33a685279895d9480f90 (patch)
tree87de4f6c65d4057865579f142106d0514f528ed7
parented36eb0fc548edb334a9e6f2e9a6ebf6610f2f2c (diff)
ext/ffmpeg/gstffmpegdemux.c: Allow ffmpeg typefinders to try and typefind very short (<4kB) files.
Original commit message from CVS: * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_type_find): Allow ffmpeg typefinders to try and typefind very short (<4kB) files.
-rw-r--r--ChangeLog6
m---------common0
-rw-r--r--ext/ffmpeg/gstffmpegdemux.c11
3 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e2f655c..5726bac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-20 Michael Smith <msmith@fluendo.com>
+
+ * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_type_find):
+ Allow ffmpeg typefinders to try and typefind very short (<4kB)
+ files.
+
2007-04-12 Wim Taymans <wim@fluendo.com>
Patch by: Mark Nauwelaerts <manauw at skynet dot be> and
diff --git a/common b/common
-Subproject 9097e252e477e18182f08a032d8860bdee9a041
+Subproject 765d03a88492fb4ac81d70457f671f3a109e93d
diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c
index fd18b9c..d780e45 100644
--- a/ext/ffmpeg/gstffmpegdemux.c
+++ b/ext/ffmpeg/gstffmpegdemux.c
@@ -1113,14 +1113,21 @@ gst_ffmpegdemux_type_find (GstTypeFind * tf, gpointer priv)
GstFFMpegDemuxClassParams *params = (GstFFMpegDemuxClassParams *) priv;
AVInputFormat *in_plugin = params->in_plugin;
gint res = 0;
+ guint64 length;
+
+ /* 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;
if (in_plugin->read_probe &&
- (data = gst_type_find_peek (tf, 0, GST_FFMPEG_TYPE_FIND_SIZE)) != NULL) {
+ (data = gst_type_find_peek (tf, 0, length)) != NULL) {
AVProbeData probe_data;
probe_data.filename = "";
probe_data.buf = data;
- probe_data.buf_size = GST_FFMPEG_TYPE_FIND_SIZE;
+ probe_data.buf_size = length;
res = in_plugin->read_probe (&probe_data);
if (res > 0) {