forked from FFmpeg/FFmpeg
lavf: fall back to a more meaningful log instance name
An uninitialized AVFormatContext instance with neither iformat nor oformat set will currently log as 'NULL', which is confusing and unhelpful. Print 'AVFormatContext' instead, which provides more information. This happens e.g. if choosing an output format fails in avformat_alloc_output_context2(). E.g. with the following commandline: ffmpeg -i <input> -f foobar -y /dev/null before: [NULL @ 0x5580377834c0] Requested output format 'foobar' is not a suitable output format after: [AVFormatContext @ 0x55fa15bb34c0] Requested output format 'foobar' is not a suitable output format
This commit is contained in:
parent
97c95961f0
commit
dffb058f3b
1 changed files with 1 additions and 1 deletions
|
@ -44,7 +44,7 @@ static const char* format_to_name(void* ptr)
|
|||
AVFormatContext* fc = (AVFormatContext*) ptr;
|
||||
if(fc->iformat) return fc->iformat->name;
|
||||
else if(fc->oformat) return fc->oformat->name;
|
||||
else return "NULL";
|
||||
else return fc->av_class->class_name;
|
||||
}
|
||||
|
||||
static void *format_child_next(void *obj, void *prev)
|
||||
|
|
Loading…
Add table
Reference in a new issue