[MPlayer-dev-eng] [PATCH] libmpdemux/demux_audio: Fix audio time length.
Benoît Thébaudeau
benoit.thebaudeau at advansee.com
Sun Mar 18 18:44:22 CET 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?
More information about the MPlayer-dev-eng
mailing list