[MPlayer-dev-eng] vbr mp3 runtime

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Oct 26 20:44:22 CEST 2011


On Wed, Oct 26, 2011 at 02:53:19PM +0200, Ingo Brückl wrote:
> Reimar Döffinger wrote on Tue, 25 Oct 2011 18:32:04 +0200:
> > Not much point yet, but in principle I'm in favour of completely
> > avoiding off_t, it tends to be 32 bit on MinGW, which means that
> > supporting large files without hacking the system headers is basically
> > not possible.
> > If we had used (u)int64_t everywhere it would just be a matter of using
> > the 64 bit functions in stream_file...
> 
> I was just using the data type that is used in the demuxer structure as well.
> Does it make sense to change to another type here?

Hard question.
Though personally it's good to just write new code to more sane
principles even if the types are a bit chaotic until someone actually
takes the time for some cleanup

> So, may I commit then?

I said you may already, don't let me hold you back.
I do have a nitpick still though...

> +    duration = (double) mp3_vbr_frames(s, demuxer->movi_start) * mp3_found->mpa_spf / mp3_found->mp3_freq;
>      free(mp3_found);
>      mp3_found = NULL;
>      if(s->end_pos && (s->flags & MP_STREAM_SEEK) == MP_STREAM_SEEK) {
> @@ -381,6 +445,8 @@
>  	demux_info_add(demuxer,"Genre",genres[g]);
>        }
>      }
> +    if (duration && demuxer->movi_end) sh_audio->wf->nAvgBytesPerSec = demuxer->movi_end / duration;

I think maximum-pedantically this should be
if (duration && demuxer->movi_end && demuxer->movi_end > demuxer->movi_start)
    sh_audio->wf->nAvgBytesPerSec = (demuxer->movi_end - demuxer->movi_start) / duration;

Though I suspect the VBR code is unlikely to be of use when combined with the -sb
option...


More information about the MPlayer-dev-eng mailing list