From 4aa57ea7e540a33db8d69460c5748add3f4928e6 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 14 Feb 2006 17:13:11 +0000 Subject: [PATCH] ext/ffmpeg/gstffmpegdemux.c: If the duration returned by ffmpeg is 0, it doesn't mean the file has no duration, but t... Original commit message from CVS: * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_open): If the duration returned by ffmpeg is 0, it doesn't mean the file has no duration, but that it doesn't know the end. Fixed accordingly for segment_stop. --- ChangeLog | 7 +++++++ ext/ffmpeg/gstffmpegdemux.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a281750..831a7c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-02-14 Edward Hervey + + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_open): + If the duration returned by ffmpeg is 0, it doesn't mean the file has + no duration, but that it doesn't know the end. + Fixed accordingly for segment_stop. + 2006-02-13 Edward Hervey * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_release_buffer), diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index e31d542..b38b4a6 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -803,7 +803,10 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux) /* remember initial start position and shift start/stop */ demux->timeoffset = demux->context->start_time * (GST_SECOND / AV_TIME_BASE ); demux->segment_start = 0; - demux->segment_stop = demux->context->duration * (GST_SECOND / AV_TIME_BASE ); + if (demux->context->duration > 0) + demux->segment_stop = demux->context->duration * (GST_SECOND / AV_TIME_BASE ); + else + demux->segment_stop = GST_CLOCK_TIME_NONE; /* Send newsegment on all src pads */ for (res = 0; res < demux->context->nb_streams; res++) { -- 2.7.4