[MPlayer-dev-eng] [PATCH] libmpdemux/demux_audio: Fix audio time length.
Benoît Thébaudeau
benoit.thebaudeau at advansee.com
Fri May 18 18:20:39 CEST 2012
On Tue, Jan 17, 2012 at 07:45:02PM +0100, Benoît Thébaudeau wrote:
> Reimar,
>
> > > diff -Nrdup mplayer.orig/libmpdemux/demux_audio.c
> > > mplayer/libmpdemux/demux_audio.c
> > > --- mplayer.orig/libmpdemux/demux_audio.c 2012-01-17
> > > 15:03:29.757246846 +0100
> > > +++ mplayer/libmpdemux/demux_audio.c 2012-01-17
> > > 15:11:47.549260678
> > > +0100
> > > @@ -787,7 +787,9 @@ static void demux_close_audio(demuxer_t*
> > >
> > > static int demux_audio_control(demuxer_t *demuxer,int cmd, void
> > > *arg){
> > > sh_audio_t *sh_audio=demuxer->audio->sh;
> > > - int audio_length = sh_audio->i_bps ? demuxer->movi_end /
> > > sh_audio->i_bps : 0;
> > > + off_t movi_size = (demuxer->movi_end > demuxer->movi_start)
> > > ?
> > > + demuxer->movi_end - demuxer->movi_start :
> > > demuxer->movi_end;
> > > + int audio_length = sh_audio->i_bps ? movi_size /
> > > sh_audio->i_bps : 0;
> >
> > Hm, is there much point/sense in falling back to just movi_end?
> > I would have suggest something like e.g.
> > int audio_length = sh_audio->i_bps && demuxer->movi_end >
> > demuxer->movi_start ? ... : 0;
>
> I don't know. I just put that because it was the previous code, and
> because
> it might be a better length indication than 0 even if not accurate.
>
> I attach the patch with your suggestion.
Ping?
Thanks in advance.
Regards,
Benoît
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4-fix-audio-length.patch
Type: text/x-patch
Size: 730 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120518/0e012a89/attachment.bin>
More information about the MPlayer-dev-eng
mailing list