[FFmpeg-devel] [PATCH] avf:rmdec.c fill duration to AVFormatContext
michaelni at gmx.at
Thu Jul 12 18:37:47 CEST 2012
On Thu, Jul 12, 2012 at 10:36:51AM +0800, William Yu wrote:
> 2012/7/11 Michael Niedermayer <michaelni at gmx.at>:
> > On Wed, Jul 11, 2012 at 01:12:19PM +0800, William Yu wrote:
> >> 2012/7/6 Michael Niedermayer <michaelni at gmx.at>:
> >> > On Fri, Jul 06, 2012 at 12:29:15PM +0800, William Yu wrote:
> >> >> I think rmdec should fill duration to AVFormatContext so that ffprobe
> >> >> can check duration for rm file.
> >> >>
> >> >> ---
> >> >> libavformat/rmdec.c | 3 ++-
> >> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >> >>
> >> >> diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
> >> >> index d919a9a..901bcc8 100644
> >> >> --- a/libavformat/rmdec.c
> >> >> +++ b/libavformat/rmdec.c
> >> >> @@ -475,7 +475,8 @@ static int rm_read_header(AVFormatContext *s)
> >> >> avio_rb32(pb); /* max packet size */
> >> >> avio_rb32(pb); /* avg packet size */
> >> >> avio_rb32(pb); /* nb packets */
> >> >> - avio_rb32(pb); /* duration */
> >> >> + duration = avio_rb32(pb); /* duration */
> >> >> + s->duration = av_rescale(duration, AV_TIME_BASE, 1000);
> >> >> avio_rb32(pb); /* preroll */
> >> >
> >> > isnt the MDPR parsing code enough to get this set already ?
> >> Sorry for my delay.
> >> I have a rm file. It only set duration in PROP. video and audio
> >> stream's duration in MDPR are zero.
> >> But MediaInfo can show this file's duration.
> >> > if no, can you share the rm file that needs this
> >> I have not a host to share this rm file. What can i do for share this
> >> file in another way? This file size is exceed 27M.
> > see "Submitting Sample Media" on http://ffmpeg.org/bugreports.html
> > also once uploaded please tell us the filename
> The rm file has been upload to ftp://ftp.ffmpeg.org/incoming.
> The file name is zero_dur.rmvb
AVFormatContext.duration should only be set if no AVStream duration
is&can be set. (see docs in avformat.h)
the patch should be ok if its changed accordingly
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel