]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/internal.h
mkv: Validate ASS Start and End fields
[ffmpeg] / libavformat / internal.h
index 28244362862dcd1b91af6c8665c3bca272800871..d10c5433d0a8d45dbf4a2c38109ad780c029c9c8 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <stdint.h>
 #include "avformat.h"
+#include "os_support.h"
 
 #define MAX_URL_SIZE 4096
 
@@ -323,11 +324,9 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
 /**
  * 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);
 
-int ff_get_audio_frame_size(AVCodecContext *enc, int size, int mux);
-
 unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id);
 
 enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag);
@@ -353,4 +352,18 @@ enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags);
  */
 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)
+{
+    if (rename(oldpath, newpath) == -1)
+        return AVERROR(errno);
+    return 0;
+}
+
 #endif /* AVFORMAT_INTERNAL_H */