X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Finternal.h;h=ce03dac3dd72756a32371d1408f750b55db5b09e;hp=30117069a94862924bd0103279002f6d3bbd4e1f;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavformat/internal.h b/ffmpeg/libavformat/internal.h index 3011706..ce03dac 100644 --- a/ffmpeg/libavformat/internal.h +++ b/ffmpeg/libavformat/internal.h @@ -23,6 +23,7 @@ #include #include "avformat.h" +#include "os_support.h" #define MAX_URL_SIZE 4096 @@ -334,7 +335,7 @@ void ff_free_stream(AVFormatContext *s, AVStream *st); /** * Return the frame duration in seconds. Return 0 if not available. */ -void ff_compute_frame_duration(int *pnum, int *pden, AVStream *st, +void ff_compute_frame_duration(AVFormatContext *s, int *pnum, int *pden, AVStream *st, AVCodecParserContext *pc, AVPacket *pkt); unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id); @@ -371,6 +372,24 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precisio */ int ff_generate_avci_extradata(AVStream *st); +/** + * Wrap errno on rename() error. + * + * @param oldpath source path + * @param newpath destination path + * @return 0 or AVERROR on failure + */ +static inline int ff_rename(const char *oldpath, const char *newpath, void *logctx) +{ + int ret = 0; + if (rename(oldpath, newpath) == -1) { + ret = AVERROR(errno); + if (logctx) + av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s\n", oldpath, newpath); + } + return ret; +} + /** * Allocate extradata with additional FF_INPUT_BUFFER_PADDING_SIZE at end * which is always set to 0. @@ -412,5 +431,9 @@ enum AVWriteUncodedFrameFlags { }; +/** + * Copies the whilelists from one context to the other + */ +int ff_copy_whitelists(AVFormatContext *dst, AVFormatContext *src); #endif /* AVFORMAT_INTERNAL_H */