diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index fd565849fa..15bd3ae030 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3079,6 +3079,17 @@ typedef struct AVCodecContext { * - decoding: unused. */ uint16_t *chroma_intra_matrix; + + /** + * dump format seperator. + * can be ", " or "\n " or anything else + * Code outside libavcodec should access this field using AVOptions + * (NO direct access). + * - encoding: Set by user. + * - decoding: Set by user. + */ + uint8_t *dump_separator; + } AVCodecContext; AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index b9b79f927e..6de75bbcf5 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -469,6 +469,7 @@ static const AVOption avcodec_options[] = { {"bb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BB }, 0, 0, V|D|E, "field_order" }, {"tb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_TB }, 0, 0, V|D|E, "field_order" }, {"bt", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BT }, 0, 0, V|D|E, "field_order" }, +{"dump_separator", "set information dump field separator", OFFSET(dump_separator), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, A|V|S|D|E}, {NULL}, }; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 69c940b793..d235678779 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -2950,6 +2950,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) int bitrate; int new_line = 0; AVRational display_aspect_ratio; + const char *separator = enc->dump_separator ? enc->dump_separator : ", "; if (!buf || buf_size <= 0) return; @@ -2987,7 +2988,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) char detail[256] = "("; const char *colorspace_name; - av_strlcat(buf, "\n ", buf_size); + av_strlcat(buf, separator, buf_size); snprintf(buf + strlen(buf), buf_size - strlen(buf), "%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" : @@ -3039,7 +3040,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) } break; case AVMEDIA_TYPE_AUDIO: - av_strlcat(buf, "\n ", buf_size); + av_strlcat(buf, separator, buf_size); if (enc->sample_rate) { snprintf(buf + strlen(buf), buf_size - strlen(buf), "%d Hz, ", enc->sample_rate); diff --git a/libavcodec/version.h b/libavcodec/version.h index 6ac5e7cbda..08db3b01a4 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,8 +29,8 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 56 -#define LIBAVCODEC_VERSION_MINOR 3 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MINOR 4 +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \