[FFmpeg-devel] [PATCH 2/2] fftools: add -report option.
Michael Niedermayer
michaelni at gmx.at
Fri Dec 9 00:24:45 CET 2011
On Thu, Dec 08, 2011 at 02:45:33PM +0100, Nicolas George wrote:
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
[...]
> @@ -424,6 +477,38 @@ int opt_loglevel(const char *opt, const char *arg)
> return 0;
> }
>
> +int opt_report(const char *opt)
> +{
> + char filename[64];
> + time_t now;
> + struct tm *tm;
> +
> + if (report_file) /* already opened */
> + return 0;
> + time(&now);
> + tm = localtime(&now);
> + snprintf(filename, sizeof(filename), "%s-%04d%02d%02d-%02d%02d%02d.log",
> + program_name,
> + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
> + tm->tm_hour, tm->tm_min, tm->tm_sec);
> + report_file = fopen(filename, "w");
> + if (!report_file) {
> + av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n",
> + filename, strerror(errno));
> + return AVERROR(errno);
> + }
> + av_log_set_callback(log_callback_report);
> + av_log(NULL, AV_LOG_INFO,
> + "%s started on %04d-%02d-%02d at %02d:%02d:%02d\n"
> + "Report written to \"%s\"\n",
> + program_name,
> + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
> + tm->tm_hour, tm->tm_min, tm->tm_sec,
> + filename);
> + opt_loglevel("loglevel", "verbose");
i think this should only increase verbosity but never decrease it
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111209/a0f3fef7/attachment.asc>
More information about the ffmpeg-devel
mailing list