[FFmpeg-soc] [soc]: r4321 - in concat/libavformat: . m3u.c playlist.c playlist.h

Diego Biurrun diego at biurrun.de
Mon Jun 1 23:15:45 CEST 2009


On Sat, May 30, 2009 at 02:20:08AM +0200, gkovacs wrote:
> 
> Log:
> added initial playlist infrastructure with simple m3u demuxer, tested mostly with ffplay
> 
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ concat/libavformat/m3u.c	Sat May 30 02:20:08 2009	(r4321)
> @@ -0,0 +1,245 @@
> +
> +#if CONFIG_PLAYLIST_MUXER
> +/* AUDIO_FILE header */
> +static int put_m3u_header(ByteIOContext *pb, AVCodecContext *enc)
> +{
> +    if(!enc->codec_tag)
> +        return -1;

Please consistently use K&R coding style, i.e. 'if (..) {'.

> +    put_tag(pb, ".snd");       /* magic number */
> +    put_be32(pb, 24);           /* header size */
> +    put_be32(pb, M3U_UNKNOWN_SIZE); /* data size */
> +    put_be32(pb, (uint32_t)enc->codec_tag);     /* codec ID */
> +    put_be32(pb, enc->sample_rate);
> +    put_be32(pb, (uint32_t)enc->channels);

A lot of this could be aligned for better readability.

> +static int m3u_list_files(unsigned char *buffer, int buffer_size, unsigned char **file_list, unsigned int *lfx_ptr)

Please keep lines below 80 cahracters where reasonably possible.

> +static int m3u_read_header(AVFormatContext *s,
> +                          AVFormatParameters *ap)
> +
> +static int m3u_read_packet(AVFormatContext *s,
> +                          AVPacket *pkt)

wrong indentation

> +#if CONFIG_M3U_MUXER
> +AVOutputFormat m3u_muxer = {
> +};
> +#endif //CONFIG_M3U_MUXER

pointless #endif comment

> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ concat/libavformat/playlist.c	Sat May 30 02:20:08 2009	(r4321)
> @@ -0,0 +1,167 @@
> +/*
> + * M3U muxer and demuxer

Wait, you already wrote this in the other C file, what gives?

> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ concat/libavformat/playlist.h	Sat May 30 02:20:08 2009	(r4321)
> @@ -0,0 +1,50 @@
> +/*
> + * M3U muxer and demuxer

ditto

This header is missing multiple inclusion guards.

Diego


More information about the FFmpeg-soc mailing list