summaryrefslogtreecommitdiff
path: root/libavutil/file.c
Commit message (Collapse)AuthorAge
* avutil/file: add more check befor destory the bufferJun Zhao2019-08-30
| | | | | | | add more check befor destory the buffer Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/file: always set *size to zero if *bufptr is NULLJun Zhao2019-08-30
| | | | | | | | | Always set *size to zero if *bufptr is NULL, it's more make sence. fix #8095 Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/file: allow mapping 0 byte files with av_file_mapMarton Balint2018-09-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24'James Almer2017-11-01
|\ | | | | | | | | | | | | * commit '97cfe1d8bd1968143e2ba9aa46ebe9504a835e24': Convert all AVClass struct declarations to designated initializers. Merged-by: James Almer <jamrial@gmail.com>
| * Convert all AVClass struct declarations to designated initializers.Diego Biurrun2017-06-12
| |
* | Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-11
|\| | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avutil/file: Move av_tempfile() to avutil/file_open ff_tempfile()Michael Niedermayer2016-03-12
| | | | | | | | | | | | | | document the issue with av_tempfile() Tested-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'bf704132a51f5d838365158331d4e535e1df4c8e'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | * commit 'bf704132a51f5d838365158331d4e535e1df4c8e': Don't anonymously typedef structs Conflicts: avprobe.c libavutil/parseutils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
* | Merge commit '0a024268261d05ccdcf7e03c85fb78d22037a464'Michael Niedermayer2014-08-26
|\| | | | | | | | | | | | | | | | | | | | | * commit '0a024268261d05ccdcf7e03c85fb78d22037a464': libxvid: K&R formatting cosmetics Conflicts: libavcodec/libxvid.c libavcodec/libxvid_rc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'a76d0cdf21c3d9e464623cc0ad1c005abf952afa'Michael Niedermayer2013-08-10
|\| | | | | | | | | | | | | * commit 'a76d0cdf21c3d9e464623cc0ad1c005abf952afa': libavutil: Move avpriv_open to a new file, file_open.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavutil: Move avpriv_open to a new file, file_open.cMartin Storsjö2013-08-10
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'dfc6b5c81491abf7effb97b23af17ccf7adcd132'Michael Niedermayer2013-08-09
|\| | | | | | | | | | | | | * commit 'dfc6b5c81491abf7effb97b23af17ccf7adcd132': file: Move win32 utf8->wchar open wrapper to libavutil Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * file: Move win32 utf8->wchar open wrapper to libavutilMartin Storsjö2013-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | When libavformat was changed to use the new avpriv_open function in 51eb213d001, this silently bypassed the existing wrapper for win32. Move the win32 wrapper into libavutil/file.c to make sure it gets called everywhere (not just in the libavformat case). This makes sure that non-ascii file names gets opened properly (where file names internally are stored as utf8, but they get converted to wchar_t and opened with _wsopen). Signed-off-by: Martin Storsjö <martin@martin.st>
| * libavutil: Don't use fcntl if the function does not existDerek Buitenhuis2013-08-08
| | | | | | | | | | | | | | Not all platforms have the function. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* | libavutil: Don't use fcntl if the function does not existDerek Buitenhuis2013-08-08
| | | | | | | | | | | | | | Not all platforms have the function. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '869b04e89154cd92d2bcfdabcecbe3217864c099'Michael Niedermayer2013-08-08
|\| | | | | | | | | | | | | * commit '869b04e89154cd92d2bcfdabcecbe3217864c099': libavutil: add avpriv_open() to open files with close-on-exec flag Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavutil: add avpriv_open() to open files with close-on-exec flagRémi Denis-Courmont2013-08-07
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-11-30
|\| | | | | | | | | | | | | | | * qatar/master: avutil: Include io.h with a separate condition from MapViewOfFile cmdutils: Use a configure check for enabling CommandLineToArgvW Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: Include io.h with a separate condition from MapViewOfFileMartin Storsjö2012-11-29
| | | | | | | | | | | | | | | | | | | | | | The existence of MapViewOfFile isn't linked to the existence of io.h. Not all versions of windows have MapViewOfFile (in particular, Windows Phone 8 and the "metro" windows 8 API subset don't), while they still have io.h (and need it for open/read/close). Signed-off-by: Martin Storsjö <martin@martin.st>
* | av_tempfile: fix leak in error caseMichael Niedermayer2012-10-11
| | | | | | | | | | Fixes CID733796 Part2 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Fix even more missing includes after the common.h removal build: Factor out rangecoder dependencies to CONFIG_RANGECODER build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE x86: avcodec: Consistently name all init files Add more missing includes after removing the implicit common.h Add some more missing includes after removing the implicit common.h Don't include common.h from avutil.h rtmp: Automatically compute the hash for SWFVerification Conflicts: configure doc/APIchanges doc/examples/decoding_encoding.c libavcodec/Makefile libavcodec/assdec.c libavcodec/audio_frame_queue.c libavcodec/avpacket.c libavcodec/dv_profile.c libavcodec/dwt.c libavcodec/libtheoraenc.c libavcodec/rawdec.c libavcodec/rv40dsp.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/v210dec.h libavcodec/vc1dsp.c libavcodec/x86/Makefile libavfilter/asrc_anullsrc.c libavfilter/avfilter.c libavfilter/buffer.c libavfilter/formats.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_select.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/version.h libavutil/audioconvert.c libavutil/error.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add some more missing includes after removing the implicit common.hMartin Storsjö2012-08-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * Don't include common.h from avutil.hMartin Storsjö2012-08-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: libspeexenc: add supported sample rates and channel layouts. Replace usleep() calls with av_usleep() lavu: add av_usleep() function utvideo: mark interlaced frames as such utvideo: Fix interlaced prediction for RGB utvideo. cosmetics: do not use full path for local headers lavu/file: include unistd.h only when available configure: check for unistd.h log: include unistd.h only when needed lavf: include libavutil/time.h instead of redeclaring av_gettime() Conflicts: configure doc/APIchanges ffmpeg.c ffplay.c libavcodec/utvideo.c libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavu/file: include unistd.h only when availableMans Rullgard2012-06-21
| | | | | | | | | | | | | | | | The unistd.h header is only needed for the close() declaration. If this header is not available, the close() declaration may be provided by another header, e.g. io.h. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (71 commits) movenc: Allow writing to a non-seekable output if using empty moov movenc: Support adding isml (smooth streaming live) metadata libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set sunrast: Document the different Sun Raster file format types. sunrast: Add a check for experimental type. libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat lavf: remove disabled FF_API_SET_PTS_INFO cruft lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft lavf: remove disabled FF_API_REORDER_PRIVATE cruft lavf: remove disabled FF_API_SEEK_PUBLIC cruft lavf: remove disabled FF_API_STREAM_COPY cruft lavf: remove disabled FF_API_PRELOAD cruft lavf: remove disabled FF_API_NEW_STREAM cruft lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft lavf: remove disabled FF_API_MUXRATE cruft lavf: remove disabled FF_API_FILESIZE cruft lavf: remove disabled FF_API_TIMESTAMP cruft lavf: remove disabled FF_API_LOOP_OUTPUT cruft lavf: remove disabled FF_API_LOOP_INPUT cruft lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft ... Conflicts: doc/APIchanges libavcodec/8bps.c libavcodec/avcodec.h libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/options.c libavcodec/sunrast.c libavcodec/utils.c libavcodec/version.h libavcodec/x86/h264_deblock.asm libavdevice/libdc1394.c libavdevice/v4l2.c libavformat/avformat.h libavformat/avio.c libavformat/avio.h libavformat/aviobuf.c libavformat/dv.c libavformat/mov.c libavformat/utils.c libavformat/version.h libavformat/wtv.c libavutil/Makefile libavutil/file.c libswscale/x86/input.asm libswscale/x86/swscale_mmx.c libswscale/x86/swscale_template.c tests/ref/lavf/ffm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavutil: Remove pointless file test program.Diego Biurrun2012-01-26
| |
* | av_tempfile: dont try the current directory with mkstemp() unless we are on ↵Michael Niedermayer2011-10-16
| | | | | | | | | | | | windows Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_tempfile: change mode for fallback to 0600 to match mkstemp()Michael Niedermayer2011-10-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_tempfile: Pass int log_offset, void *log_ctxMichael Niedermayer2011-10-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_tempfile: fix error codesMichael Niedermayer2011-10-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_tempfile: use O_EXCLMichael Niedermayer2011-10-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_tempfile: try tempnam(NULL) firstMichael Niedermayer2011-10-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_tempfile: handle missing O_BINARYMichael Niedermayer2011-10-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_tempfile: fix alloc type for !HAVE_MKSTEMPMichael Niedermayer2011-10-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Move av_tempfile() into libavutil, it is a generically usefull thing and its ↵Michael Niedermayer2011-10-16
| | | | | | | | | | | | small. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (40 commits) H.264: template left MB handling H.264: faster fill_decode_caches H.264: faster write_back_* H.264: faster fill_filter_caches H.264: make filter_mb_fast support the case of unavailable top mb Do not include log.h in avutil.h Do not include pixfmt.h in avutil.h Do not include rational.h in avutil.h Do not include mathematics.h in avutil.h Do not include intfloat_readwrite.h in avutil.h Remove return statements following infinite loops without break RTSP: Doxygen comment cleanup doxygen: Escape '\' in Doxygen documentation. md5: cosmetics md5: use AV_WL32 to write result md5: add fate test md5: include correct headers md5: fix test program doxygen: Drop array size declarations from Doxygen parameter names. doxygen: Fix parameter names to match the function prototypes. ... Conflicts: libavcodec/x86/dsputil_mmx.c libavformat/flvenc.c libavformat/oggenc.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Do not include log.h in avutil.hMans Rullgard2011-07-03
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Fix error check in av_file_map()Mans Rullgard2011-06-04
| | | | | | | | | | | | On failure, mmap() returns MAP_FAILED, which may or may not be -1. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Use MAP_FAILED to check for mmap failure instead of manuallyReimar Döffinger2011-05-07
| | | | | | | | recreating the value.
* | file: Fix mmap error check.Michael Niedermayer2011-05-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-04-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (37 commits) In avcodec_open(), set return code to an error value only when an error occurs instead of unconditionally at the start of the function. lavc: remove reference to opt.h from Makefile. prefer avio_check() over url_exist() avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols lavu: remove misc disabled cruft lavu: remove FF_API_OLD_IMAGE_NAMES cruft NOT PULLED lavu: remove FF_API_OLD_EVAL_NAMES cruft lavc: remove misc disabled cruft. lavc: remove the FF_API_INOFFICIAL cruft. lavc: remove the FF_API_SET_STRING_OLD cruft. lavc: remove the FF_API_USE_LPC cruft. lavc: remove the FF_API_SUBTITLE_OLD cruft. lavc: remove the FF_API_VIDEO_OLD cruft. lavc: remove the FF_API_AUDIO_OLD cruft. lavc: remove the FF_API_OPT_SHOW cruft. lavc: remove the FF_API_MM_FLAGS cruft. lavf: remove misc disabled cruft. lavf: remove FF_API_INDEX_BUILT cruft lavf: remove FF_API_URL_CLASS cruft. lavf: remove FF_API_SYMVER cruft ... Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavu: remove misc disabled cruftAnton Khirnov2011-04-19
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Win32 support for av_file_map()Daniel Verkamp2011-01-05
| | | | Originally committed as revision 26221 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix av_file_map(): replace stat(filename, &st) with fstat(fd, &st).Stefano Sabatini2010-12-22
| | | | | | | The file might be replaced between open() and stat(). Spotted by Mans. Originally committed as revision 26075 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Replace lstat() with stat() in av_file_map(). The lstat() use was wrong.Stefano Sabatini2010-12-22
| | | | Originally committed as revision 26074 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add av_file_map() and av_file_unmap() functions.Stefano Sabatini2010-12-22
Originally committed as revision 26073 to svn://svn.ffmpeg.org/ffmpeg/trunk