[FFmpeg-devel] [PATCH] Lego Mindstorms RSO de/muxer (copied from au.c)

Rafaël Carré rafael.carre
Fri Jul 16 15:59:11 CEST 2010


On Fri, 16 Jul 2010 05:22:46 +0200
Michael Niedermayer <michaelni at gmx.at> wrote:

> On Thu, Jul 15, 2010 at 04:44:49PM +0200, Rafa?l Carr? wrote:

> > +    st->duration = size << 3 / bpp;
> 
> is this correct?

changed variable name to bps and use >> av_log2(bps)
it doesn't make it more correct or less correct, but it's still correct
since the duration unit for audio streams is the sample after we call
av_set_pts_info(.., .., 1, samplerate)

Also IIUC, (size << 3) >> av_log2(bps) could be written as:
size << 3 >> av_log2(bps) since associativity is left-to-right but
using parenthesis makes it more readable IMO

> > +static int rso_write_header(AVFormatContext *s)
> > +{

> > +    s->priv_data = NULL;
> 
> how did it become non null ?

it's memset to 0 in avformat_alloc_context() -> removed

and yes it was cargo cult :)


Google tells me that .rso is only known as an extension for those
Lego sounds so ditch probe function and rely on extension matching


In muxer, I only print a warning if the output file is too big, because
the resulting file will play back in FFmpeg anyway (although with
incorrect duration).
I am not sure about this since those files are meant to be played on
Lego hardware and I'm not sure if bigger files would fit or if/how Lego
software would reject too big files.
I wanted to use FF_COMPLIANCE_UNOFFICIAL but it's strictly related to
codecs.

Ideas on this?


Last thing: is it ok to not set DTS/PTS in read_packet() ?
for example raw.c (PCM) sets them but au.c/mp3.c don't

-- 
? Rafa?l Carr? ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Lego-Mindstorms-RSO-de-muxer-copied-from-au.c.patch
Type: text/x-patch
Size: 12248 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100716/31f6da34/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100716/31f6da34/attachment.pgp>



More information about the ffmpeg-devel mailing list