X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Futils.c;h=fa5bf1a894d9a67ce2a7dcefb70a0d8a11a02b4d;hb=e23e4de3aeaef701fbfa1cf6c9b4d76a01f015ff;hp=599226145a944661dc6c7a18fa557f814c3ce2f7;hpb=9d49b8ff90a40e6fdde30f30d42465c754fbf5d3;p=ffmpeg diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 599226145a9..fa5bf1a894d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -25,6 +25,9 @@ * utils. */ +/* needed for mkstemp() */ +#define _XOPEN_SOURCE 500 + #include "libavutil/integer.h" #include "libavutil/crc.h" #include "avcodec.h" @@ -32,6 +35,7 @@ #include "opt.h" #include "imgconvert.h" #include "audioconvert.h" +#include #include #include #include @@ -281,6 +285,8 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ } s->internal_buffer_count++; + pic->reordered_opaque= s->reordered_opaque; + if(s->debug&FF_DEBUG_BUFFERS) av_log(s, AV_LOG_DEBUG, "default_get_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count); @@ -758,7 +764,6 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type) flags= AV_OPT_FLAG_SUBTITLE_PARAM; av_opt_set_defaults2(s, flags, flags); - s->rc_eq= av_strdup("tex^qComp"); s->time_base= (AVRational){0,1}; s->get_buffer= avcodec_default_get_buffer; s->release_buffer= avcodec_default_release_buffer; @@ -990,7 +995,6 @@ int avcodec_close(AVCodecContext *avctx) avctx->codec->close(avctx); avcodec_default_free_buffers(avctx); av_freep(&avctx->priv_data); - av_freep(&avctx->rc_eq); avctx->codec = NULL; entangled_thread_counter--; return 0; @@ -1156,11 +1160,16 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) /* for PCM codecs, compute bitrate directly */ switch(enc->codec_id) { + case CODEC_ID_PCM_F64BE: + case CODEC_ID_PCM_F64LE: + bitrate = enc->sample_rate * enc->channels * 64; + break; case CODEC_ID_PCM_S32LE: case CODEC_ID_PCM_S32BE: case CODEC_ID_PCM_U32LE: case CODEC_ID_PCM_U32BE: case CODEC_ID_PCM_F32BE: + case CODEC_ID_PCM_F32LE: bitrate = enc->sample_rate * enc->channels * 32; break; case CODEC_ID_PCM_S24LE: @@ -1310,7 +1319,11 @@ int av_get_bits_per_sample(enum CodecID codec_id){ case CODEC_ID_PCM_U32BE: case CODEC_ID_PCM_U32LE: case CODEC_ID_PCM_F32BE: + case CODEC_ID_PCM_F32LE: return 32; + case CODEC_ID_PCM_F64BE: + case CODEC_ID_PCM_F64LE: + return 64; default: return 0; } @@ -1327,6 +1340,8 @@ int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) { case SAMPLE_FMT_S32: case SAMPLE_FMT_FLT: return 32; + case SAMPLE_FMT_DBL: + return 64; default: return 0; } @@ -1513,3 +1528,16 @@ int av_parse_video_frame_rate(AVRational *frame_rate, const char *arg) else return 0; } + +void av_log_missing_feature(void *avc, const char *feature, int want_sample) +{ + av_log(avc, AV_LOG_WARNING, "%s not implemented. Update your FFmpeg " + "version to the newest one from SVN. If the problem still " + "occurs, it means that your file has a feature which has not " + "been implemented.", feature); + if(want_sample) + av_log(avc, AV_LOG_WARNING, " If you want to help, upload a sample " + "of this file to ftp://upload.mplayerhq.hu/MPlayer/incoming/ " + "and contact the FFmpeg-devel mailing list."); + av_log(avc, AV_LOG_WARNING, "\n"); +}