[FFmpeg-cvslog] ffprobe: remove media_type_string() by inlining av_x_if_null().
Clément Bœsch
git at videolan.org
Thu Sep 22 00:42:04 CEST 2011
ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Fri Sep 16 12:54:19 2011 +0200| [03d0ea0cf09a95bc8dfacc18fe038d4883f93d4d] | committer: Clément Bœsch
ffprobe: remove media_type_string() by inlining av_x_if_null().
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=03d0ea0cf09a95bc8dfacc18fe038d4883f93d4d
---
ffprobe.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/ffprobe.c b/ffprobe.c
index 6c677e8..b298b60 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -122,12 +122,6 @@ static char *ts_value_string (char *buf, int buf_size, int64_t ts)
return buf;
}
-static const char *media_type_string(enum AVMediaType media_type)
-{
- const char *s = av_get_media_type_string(media_type);
- return s ? s : "unknown";
-}
-
struct writer {
const char *name;
@@ -315,7 +309,7 @@ static void show_packet(struct writer *w, AVFormatContext *fmt_ctx, AVPacket *pk
if (packet_idx)
printf("%s", w->items_sep);
w->print_header("PACKET");
- print_str0("codec_type", media_type_string(st->codec->codec_type));
+ print_str0("codec_type", av_x_if_null(av_get_media_type_string(st->codec->codec_type), "unknown"));
print_int("stream_index", pkt->stream_index);
print_str("pts", ts_value_string (val_str, sizeof(val_str), pkt->pts));
print_str("pts_time", time_value_string(val_str, sizeof(val_str), pkt->pts, &st->time_base));
@@ -397,7 +391,7 @@ static void show_stream(struct writer *w, AVFormatContext *fmt_ctx, int stream_i
print_str("codec_name", "unknown");
}
- print_str("codec_type", media_type_string(dec_ctx->codec_type));
+ print_str("codec_type", av_x_if_null(av_get_media_type_string(dec_ctx->codec_type), "unknown"));
print_fmt("codec_time_base", "%d/%d", dec_ctx->time_base.num, dec_ctx->time_base.den);
/* print AVI/FourCC tag */
More information about the ffmpeg-cvslog
mailing list