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.
This commit is contained in:
Edward Hervey 2006-02-14 17:13:11 +00:00
parent fa4b52bdca
commit 4aa57ea7e5
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2006-02-14 Edward Hervey <edward@fluendo.com>
* 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 <edward@fluendo.com> 2006-02-13 Edward Hervey <edward@fluendo.com>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_release_buffer), * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_release_buffer),

View file

@ -803,7 +803,10 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux)
/* remember initial start position and shift start/stop */ /* remember initial start position and shift start/stop */
demux->timeoffset = demux->context->start_time * (GST_SECOND / AV_TIME_BASE ); demux->timeoffset = demux->context->start_time * (GST_SECOND / AV_TIME_BASE );
demux->segment_start = 0; demux->segment_start = 0;
if (demux->context->duration > 0)
demux->segment_stop = demux->context->duration * (GST_SECOND / AV_TIME_BASE ); 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 */ /* Send newsegment on all src pads */
for (res = 0; res < demux->context->nb_streams; res++) { for (res = 0; res < demux->context->nb_streams; res++) {