[FFmpeg-cvslog] ffprobe: use av_get_media_type_string() in media_type_string(), simplify
Stefano Sabatini
git at videolan.org
Sat Aug 20 14:25:52 CEST 2011
ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Thu Aug 18 12:29:37 2011 +0200| [9a151467685d286e94830fc8ad8afe4c2acd8fdd] | committer: Stefano Sabatini
ffprobe: use av_get_media_type_string() in media_type_string(), simplify
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a151467685d286e94830fc8ad8afe4c2acd8fdd
---
ffprobe.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/ffprobe.c b/ffprobe.c
index 4ef9902..be7b2bf 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -117,14 +117,8 @@ static char *ts_value_string (char *buf, int buf_size, int64_t ts)
static const char *media_type_string(enum AVMediaType media_type)
{
- switch (media_type) {
- case AVMEDIA_TYPE_VIDEO: return "video";
- case AVMEDIA_TYPE_AUDIO: return "audio";
- case AVMEDIA_TYPE_DATA: return "data";
- case AVMEDIA_TYPE_SUBTITLE: return "subtitle";
- case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
- default: return "unknown";
- }
+ const char *s = av_get_media_type_string(media_type);
+ return s ? s : "unknown";
}
static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)
More information about the ffmpeg-cvslog
mailing list