[FFmpeg-devel] [PATCH 2/5] lavc: use avcodec_get_name in avcodec_string names
Michael Niedermayer
michaelni at gmx.at
Sat Aug 20 00:44:35 CEST 2011
On Wed, Aug 17, 2011 at 07:34:00PM +0200, Nicolas George wrote:
> See the commit message. With this patch, ffmpeg can report the format of
> streams even if no encoder nor decoder is available.
>
> Regards,
>
> --
> Nicolas George
> utils.c | 27 ++++++---------------------
> 1 file changed, 6 insertions(+), 21 deletions(-)
> 9b62a0a936f0e0be382d5542094e4eb4ef8bd11d 0002-lavc-use-avcodec_get_name-in-avcodec_string.patch
> From 861dd11549fc46e93a99d3f2c8bb66ad0988da8c Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Wed, 17 Aug 2011 15:40:30 +0200
> Subject: [PATCH 2/5] lavc: use avcodec_get_name in avcodec_string.
>
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
> libavcodec/utils.c | 27 ++++++---------------------
> 1 files changed, 6 insertions(+), 21 deletions(-)
>
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 1d5ec44..80d1d28 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1023,30 +1023,15 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
> const char *codec_name;
> const char *profile = NULL;
> AVCodec *p;
> - char buf1[32];
> int bitrate;
> AVRational display_aspect_ratio;
>
> - if (encode)
> - p = avcodec_find_encoder(enc->codec_id);
> - else
> - p = avcodec_find_decoder(enc->codec_id);
> -
> - if (p) {
> - codec_name = p->name;
> - profile = av_get_profile_name(p, enc->profile);
> - } else if (enc->codec_id == CODEC_ID_MPEG2TS) {
> - /* fake mpeg2 transport stream codec (currently not
> - registered) */
> - codec_name = "mpeg2ts";
> - } else if (enc->codec_name[0] != '\0') {
> - codec_name = enc->codec_name;
> - } else {
> - /* output avi tags */
> - char tag_buf[32];
> - av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);
> - snprintf(buf1, sizeof(buf1), "%s / 0x%04X", tag_buf, enc->codec_tag);
> - codec_name = buf1;
I think this is usefull to show at DEBUG level, unless we show it
elsewhere already
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- 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/20110820/29fe8d87/attachment.asc>
More information about the ffmpeg-devel
mailing list