aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-17 14:23:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-17 14:23:20 +0200
commit27fbe31c921f49078764a69ccb701dbb767c7410 (patch)
tree5a80541540a0a72063c3fa854febb77afc6518b7 /libavformat/utils.c
parentd071df888d5896031380b2b1733bd0cec833c3b6 (diff)
parent6cd9d0f77d527491d0c3626f16b8e125a8a9344b (diff)
downloadffmpeg-27fbe31c921f49078764a69ccb701dbb767c7410.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: Revert "avconv: use stream copy by default when possible." avconv: print stream copy information. avconv: use stream copy by default when possible. matroskaenc: vertical alignment. matroskaenc: implement query_codec() lavf: add avformat_query_codec(). lavc: add avcodec_get_type() for mapping codec_id -> type. flvenc: use int64_t to store offsets avconv: don't segfault on 0 input files. Do not write ID3v1 tags by default mpegts: log into an AVFormatContext rather than MpegTSContext. Conflicts: doc/APIchanges libavcodec/version.h libavformat/avformat.h libavformat/mp3enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index aa1220dbbc..022efc4d56 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4035,3 +4035,17 @@ int64_t ff_iso8601_to_unix_time(const char *datestr)
return 0;
#endif
}
+
+int avformat_query_codec(AVOutputFormat *ofmt, enum CodecID codec_id, int std_compliance)
+{
+ if (ofmt) {
+ if (ofmt->query_codec)
+ return ofmt->query_codec(codec_id, std_compliance);
+ else if (ofmt->codec_tag)
+ return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
+ else if (codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec ||
+ codec_id == ofmt->subtitle_codec)
+ return 1;
+ }
+ return AVERROR_PATCHWELCOME;
+}