On Fri, Dec 30, 2011 at 04:19:55AM +0530, Aneesh Dogra wrote:
> ---
> cmdutils.c | 212 +++++++++++++++++++++++++++++++++--------------------------
> 1 files changed, 119 insertions(+), 93 deletions(-)
>
> --- a/cmdutils.c
> +++ b/cmdutils.c
> @@ -243,7 +247,8 @@ unknown_opt:
>
> /* new-style options contain an offset into optctx, old-style address of
> * a global var*/
> - dst = po->flags & (OPT_OFFSET|OPT_SPEC) ? (uint8_t*)optctx + po->u.off :
> po->u.dst_ptr;
> + dst = po->flags & (OPT_OFFSET|OPT_SPEC) ?
> + (uint8_t*)optctx + po->u.off : po->u.dst_ptr;
dst = po->flags & (OPT_OFFSET | OPT_SPEC) ? (uint8_t*)optctx + po->u.off
: po->u.dst_ptr;
Also note the space around '|'.
> @@ -364,9 +369,10 @@ int opt_default(const char *opt, const char *arg)
> p = opt + strlen(opt);
> av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));
>
> - if ((o = av_opt_find(&cc, opt_stripped, NULL, 0,
> AV_OPT_SEARCH_CHILDREN|AV_OPT_SEARCH_FAKE_OBJ)) ||
> - ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
> - (o = av_opt_find(&cc, opt+1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ))))
> + if ((o = av_opt_find(&cc, opt_stripped, NULL, 0, AV_OPT_SEARCH_CHILDREN |
> + AV_OPT_SEARCH_FAKE_OBJ)) ||
> + ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
> + (o = av_opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ))))
I'd leave that and just add spaces around '|', you have one space too
few in the third line.
> @@ -489,7 +495,8 @@ static void print_all_libs_info(int flags, int level)
>
> void show_banner(void)
> {
> - av_log(NULL, AV_LOG_INFO, "%s version " LIBAV_VERSION ", Copyright (c)
> %d-%d the Libav developers\n",
> + av_log(NULL, AV_LOG_INFO, "%s version " LIBAV_VERSION
> + ", Copyright (c) %d-%d the Libav developers\n",
> program_name, program_birth_year, this_year);
Looks ugly IMO, just break after AV_LOG_INFO and leave it long.
> @@ -538,11 +545,13 @@ void show_license(void)
> "\n"
> "You should have received a copy of the GNU General Public License\n"
> "along with %s; if not, write to the Free Software\n"
> - "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA\n",
> + "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,"
> + " MA 02110-1301 USA\n",
> program_name, program_name, program_name
Leave those license texts alone.
> @@ -584,34 +594,34 @@ void show_formats(void)
> + last_name = "000";
> + for (;;) {
> + int decode = 0;
> + int encode = 0;
> + const char *name = NULL;
> + const char *long_name = NULL;
> +
> + while ((ofmt = av_oformat_next(ofmt))) {
> + if ((name == NULL || strcmp(ofmt->name, name) < 0) &&
> + strcmp(ofmt->name, last_name) > 0) {
> + name = ofmt->name;
> + long_name = ofmt->long_name;
> + encode = 1;
Align the '=', more below.
> @@ -685,25 +697,27 @@ void show_codecs(void)
> cap & CODEC_CAP_TRUNCATED ? "T":" ",
> p2->name,
> p2->long_name ? p2->long_name : "");
> - /* if(p2->decoder && decode==0)
> - printf(" use %s for decoding", p2->decoder->name);*/
> + /*if (p2->decoder && decode == 0)
> + printf(" use %s for decoding", p2->decoder->name);*/
Keep the space after '/*'.
> printf(
> "Note, the names of encoders and decoders do not always match, so there
> are\n"
> -"several cases where the above table shows encoder only or decoder only
> entries\n"
> +"several cases where the above table shows encoder only or decoder only "
> +"entries\n"
> "even though both encoding and decoding are supported. For example, the
> h263\n"
> -"decoder corresponds to the h263 and h263p encoders, for file formats it is
> even\n"
> +"decoder corresponds to the h263 and h263p encoders, for file formats it is "
> +"even\n"
> "worse.\n");
> }
This is not an improvement, i.e. leave as-is.
> @@ -854,10 +869,11 @@ FILE *get_preset_file(char *filename, size_t
> filename_size,
> {
> FILE *f = NULL;
> int i;
> - const char *base[3]= { getenv("AVCONV_DATADIR"),
> - getenv("HOME"),
> - AVCONV_DATADIR,
> - };
> + const char *base[3] = {
> + getenv("AVCONV_DATADIR"),
> + getenv("HOME"),
> + AVCONV_DATADIR,
> + };
Leave as-is, just move the closing } to the previous line.
> @@ -934,8 +954,10 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum
> CodecID codec_id, AVFor
> {
> AVDictionary *ret = NULL;
> AVDictionaryEntry *t = NULL;
> - AVCodec *codec = s->oformat ? avcodec_find_encoder(codec_id) :
> avcodec_find_decoder(codec_id);
> - int flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM :
> AV_OPT_FLAG_DECODING_PARAM;
> + AVCodec *codec = s->oformat ? avcodec_find_encoder(codec_id) :
> + avcodec_find_decoder(codec_id);
> + int flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM :
> + AV_OPT_FLAG_DECODING_PARAM;
See my suggestion for ternary operator formatting from above.
> @@ -960,10 +982,12 @@ AVDictionary *filter_codec_opts(AVDictionary *opts,
> enum CodecID codec_id, AVFor
> }
>
> if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
> - (codec && codec->priv_class && av_opt_find(&codec->priv_class,
> t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ)))
> + (codec && codec->priv_class && av_opt_find(&codec->priv_class,
> + t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ)))
> av_dict_set(&ret, t->key, t->value, 0);
> - else if (t->key[0] == prefix && av_opt_find(&cc, t->key+1, NULL,
> flags, AV_OPT_SEARCH_FAKE_OBJ))
> - av_dict_set(&ret, t->key+1, t->value, 0);
> + else if (t->key[0] == prefix && av_opt_find(&cc, t->key + 1, NULL,
> + flags, AV_OPT_SEARCH_FAKE_OBJ))
> + av_dict_set(&ret, t->key + 1, t->value, 0);
Wrong, these are function calls.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel