Commit f0a6874d authored by Michael Niedermayer's avatar Michael Niedermayer

avformat: Allow choosing the dump format field separator.

The default is to maintain the previous ", " for now.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e051d09c
......@@ -1713,6 +1713,16 @@ typedef struct AVFormatContext {
* via AVOptions (NO direct access).
*/
int64_t probesize2;
/**
* dump format seperator.
* can be ", " or "\n " or anything else
* Code outside libavformat should access this field using AVOptions
* (NO direct access).
* - muxing: Set by user.
* - demuxing: Set by user.
*/
uint8_t *dump_separator;
} AVFormatContext;
int av_format_get_probe_score(const AVFormatContext *s);
......
......@@ -27,6 +27,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
#include "libavutil/replaygain.h"
#include "libavutil/stereo3d.h"
......@@ -345,6 +346,7 @@ static void dump_stream_format(AVFormatContext *ic, int i,
int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
AVStream *st = ic->streams[i];
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
char *separator = ic->dump_separator;
avcodec_string(buf, sizeof(buf), st->codec, is_output);
av_log(NULL, AV_LOG_INFO, " Stream #%d:%d", index, i);
......@@ -378,7 +380,7 @@ static void dump_stream_format(AVFormatContext *ic, int i,
int tbc = st->codec->time_base.den && st->codec->time_base.num;
if (fps || tbr || tbn || tbc)
av_log(NULL, AV_LOG_INFO, "\n ");
av_log(NULL, AV_LOG_INFO, "%s", separator);
if (fps)
print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps");
......
......@@ -96,6 +96,7 @@ static const AVOption avformat_options[] = {
{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, "strict"},
{"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, "strict"},
{"max_ts_probe", "maximum number of packets to read while waiting for the first timestamp", OFFSET(max_ts_probe), AV_OPT_TYPE_INT, { .i64 = 50 }, 0, INT_MAX, D },
{"dump_separator", "set information dump field separator", OFFSET(dump_separator), AV_OPT_TYPE_STRING, {.str = ", "}, CHAR_MIN, CHAR_MAX, D|E},
{NULL},
};
......
......@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR 8
#define LIBAVFORMAT_VERSION_MINOR 9
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment