summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Moutte <julien@moutte.net>2007-07-25 15:39:43 +0000
committerJulien Moutte <julien@moutte.net>2007-07-25 15:39:43 +0000
commit4c6045a04f07d6f0fcfc2ac1a2bc70e8ea39409b (patch)
treea356e9709060b0b008b31a3ce1d072a668ab8fdc
parent489e66f5d5d08c7a0651eec325cc69b0aaab0164 (diff)
ext/ffmpeg/: Handle buffers with invalid duration correctly even in the case where we have a demuxer AND a decoder fr...
Original commit message from CVS: 2007-07-25 Julien MOUTTE <julien@moutte.net> * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_video_frame): * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop): Handle buffers with invalid duration correctly even in the case where we have a demuxer AND a decoder from ffmpeg linked. Fixes: #460274.
-rw-r--r--ChangeLog8
m---------common0
-rw-r--r--ext/ffmpeg/gstffmpegdec.c4
-rw-r--r--ext/ffmpeg/gstffmpegdemux.c5
4 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 83a8486..b3d396e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-25 Julien MOUTTE <julien@moutte.net>
+
+ * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_video_frame):
+ * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop): Handle
+ buffers with invalid duration correctly even in the case where
+ we have a demuxer AND a decoder from ffmpeg linked.
+ Fixes: #460274.
+
2007-07-13 Jan Schmidt <thaytan@mad.scientist.com>
* configure.ac:
diff --git a/common b/common
-Subproject 5167bced491ffe62251c62d6c5e7b9a7541e97e
+Subproject b3fe2a25c1cd0f4b021795d0db7330aeb338da7
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 82fc79d..e25253f 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -1397,7 +1397,9 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
*/
if (!GST_CLOCK_TIME_IS_VALID (in_duration)) {
/* if we have an input framerate, use that */
- if (ffmpegdec->format.video.fps_n != -1) {
+ if (ffmpegdec->format.video.fps_n != -1 &&
+ (ffmpegdec->format.video.fps_n != 1000 &&
+ ffmpegdec->format.video.fps_d != 1)) {
GST_LOG_OBJECT (ffmpegdec, "using input framerate for duration");
in_duration = gst_util_uint64_scale_int (GST_SECOND,
ffmpegdec->format.video.fps_d, ffmpegdec->format.video.fps_n);
diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c
index 4fdb9ac..0003a5e 100644
--- a/ext/ffmpeg/gstffmpegdemux.c
+++ b/ext/ffmpeg/gstffmpegdemux.c
@@ -1194,6 +1194,11 @@ gst_ffmpegdemux_loop (GstPad * pad)
stream->last_ts = timestamp;
}
duration = gst_ffmpeg_time_ff_to_gst (pkt.duration, avstream->time_base);
+ if (G_UNLIKELY (!duration)) {
+ GST_WARNING_OBJECT (demux, "invalid buffer duration, setting to NONE");
+ duration = GST_CLOCK_TIME_NONE;
+ }
+
GST_DEBUG_OBJECT (demux,
"pkt pts:%" GST_TIME_FORMAT