aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-061-37/+44
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (21 commits) ipmovie: do not read audio packets before the codec is known truemotion2: check size before GetBitContext initialisation avio: Only do implicit network initialization for network protocols avio: Add an URLProtocol flag for indicating that a protocol uses network adpcm: ADPCM Electronic Arts has always two channels matroskadec: Fix a bug where a pointer was cached to an array that might later move due to a realloc() fate: Add missing reference file from 9b4767e4. mov: Support MOV_CH_LAYOUT_USE_DESCRIPTIONS for labeled descriptions. 4xm: Prevent buffer overreads. mjpegdec: parse RSTn to prevent skipping other data in mjpeg_decode_scan vp3: add fate test for non-zero last coefficient vp3: fix streams with non-zero last coefficient swscale: remove unused U/V arguments from yuv2rgb_write(). timer: K&R formatting cosmetics lavf: cosmetics, reformat av_read_frame(). lavf: refactor av_read_frame() to make it easier to understand. Report an error if pitch_lag is zero in AMR-NB decoder. Revert "4xm: Prevent buffer overreads." 4xm: Prevent buffer overreads. 4xm: pass the correct remaining buffer size to decode_i2_frame(). ... Conflicts: libavcodec/4xm.c libavcodec/mjpegdec.c libavcodec/truemotion2.c libavformat/ipmovie.c libavformat/mov_chan.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: cosmetics, reformat av_read_frame().Anton Khirnov2012-01-051-12/+11
| |
| * lavf: refactor av_read_frame() to make it easier to understand.Anton Khirnov2012-01-051-25/+33
| |
* | lavf: use avg_frame_rate and packet number to exit find_stream_infoMichael Niedermayer2012-01-051-2/+7
| | | | | | | | | | | | | | qatar does this too but clobbers the AVPacket.duration by approximate values. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: revert commit bb99ae3ae924c942a634bec7711ec7ee11c38eb9Michael Niedermayer2012-01-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Author: Michael Niedermayer <michaelni@gmx.at> Date: Thu Nov 3 22:38:10 2011 +0100 lavf: fix null pointer dereference in rdt Signed-off-by: Michael Niedermayer <michaelni@gmx.at> This is no longer needed and causes various problems with RTSP Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: Fix try_decode_frame() so it doesnt loop infinitely.Michael Niedermayer2012-01-041-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-041-19/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: fate: add dxtory test adx_parser: rewrite. adxdec: Validate channel count to fix a division by zero. adxdec: Do not require extradata. cmdutils: K&R reformatting cosmetics alacdec: implement the 2-pass prediction type. alacenc: implement the 2-pass prediction type. alacenc: do not generate invalid multi-channel ALAC files alacdec: fill in missing or guessed info about the extradata format. utvideo: proper median prediction for interlaced videos lavu: bump lavu minor for av_popcount64 dca: K&R formatting cosmetics dct: K&R formatting cosmetics lavf: flush decoders in avformat_find_stream_info(). win32: detect number of CPUs using affinity Add av_popcount64 snow: Restore three mistakenly removed casts. Conflicts: cmdutils.c doc/APIchanges libavcodec/adx_parser.c libavcodec/adxdec.c libavcodec/alacenc.c libavutil/avutil.h tests/fate/screen.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: flush decoders in avformat_find_stream_info().Anton Khirnov2012-01-031-19/+19
| | | | | | | | | | This means that avformat_find_stream_info() now works properly with multiple threads, so there's no need to force thread count to 1.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-011-5/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: FATE: add tests for dfa mpegaudiodec: fix seeking. mpegaudiodec: fix compilation when testing the unchecked bitstream reader threads: add sysconf based number of CPUs detection threads: always include necessary headers for number of CPUs detection threads: default to automatic thread count detection Changelog: restore version <next> header cook: K&R formatting cosmetics Conflicts: Changelog libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * threads: default to automatic thread count detectionJanne Grunau2011-12-311-4/+15
| |
* | lavf: ffio_limit(), treat avio_size()==0 as error.Michael Niedermayer2011-12-311-1/+1
| | | | | | | | | | | | | | | | This works around issues arising from inputs that claim to have a filesize of 0. Reported-by: buzz_ Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avio: Fix ffio_limit() when due to seeking past the end less than 0 bytes ↵Michael Niedermayer2011-12-251-1/+2
| | | | | | | | | | | | remain. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavformat: increase LIBAVFORMAT_VERSION_MICRO to 100Michael Niedermayer2011-12-221-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-221-0/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (27 commits) asfdec: add side data to ASFStream packet instead of output packet. idroqdec: set AVFMTCTX_NOHEADER and create streams as they occur. nellymoserdec: Indicate that the decoder can handle changed parameters libavcodec: Apply parameter change side data when decoding audio flvdec: Add param change side data if the sample rate or channels have changed libavformat: Add a utility function for adding parameter change side data libavcodec: Define a side data type for parameter changes aacdec: Handle new extradata passed as side data flvdec: Export new AAC/H.264 extradata as side data on the next packet libavcodec: Define a side data type for new extradata flacdec: skip all track indices at once instead of looping. mxf: Add PictureEssenceCoding UL for V210. mxfdec: consider QuantizationBits between 17 and 24 to be pcm_s24* mxfenc: Add support for MPEG-2 MP@HL-14 in mxf container. mxf: H.264/MPEG-4 AVC Intra support configure: Show whether the safe bitstream reader is enabled x86: Tighten register constraints for decode_significance*_x86. Replace Subversion revisions in comments by Git hashes. h264_cabac: synchronize decode_significance_*_x86 conditionals w32threads: wait for the waked thread in pthread_cond_signal. ... Conflicts: libavcodec/avcodec.h libavcodec/version.h libavformat/flvdec.c libavformat/utils.c tests/ref/lavfi/pixdesc tests/ref/lavfi/pixfmts_copy tests/ref/lavfi/pixfmts_null tests/ref/lavfi/pixfmts_scale tests/ref/lavfi/pixfmts_vflip Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Add a utility function for adding parameter change side dataMartin Storsjö2011-12-211-0/+43
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavf: split out ffio_limit()Michael Niedermayer2011-12-191-4/+8
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-191-9/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: APIchanges: fill in revision for AVFrame.age deprecation avcodec: deprecate AVFrame.age 4xm: remove unneeded check for remaining unused data. lavf: force threads to 1 in avformat_find_stream_info() swscale: fix overflows in vertical scaling at top/bottom edges. lavf: add OpenMG audio muxer. omadec: split data that will be used in the muxer to a separate file. lavf: rename oma.c -> omadec.c tmv decoder: set correct pix_fmt Conflicts: Changelog doc/APIchanges libavcodec/mpegvideo.c libavcodec/version.h libavformat/oma.c libavformat/version.h libswscale/swscale.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: force threads to 1 in avformat_find_stream_info()Anton Khirnov2011-12-181-0/+5
| | | | | | | | | | Fixes avformat_find_stream_info() on streams with number of frames < thread count.
* | lavf: print an error if a packet has been truncated due to filesizeMichael Niedermayer2011-12-161-2/+4
| | | | | | | | | | | | in av_get_packet() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: Update AVIOContext.maxsize when hitting the end.Michael Niedermayer2011-12-161-3/+10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: add internal AVIOContext.maxsizeMichael Niedermayer2011-12-161-1/+9
| | | | | | | | | | | | This allows simple and generic limiting of allocations used for packets. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: update rfps debug code.Michael Niedermayer2011-12-151-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: Fix fps misdetection when codec_info_duration is 0 and only a few ↵Michael Niedermayer2011-12-151-0/+2
| | | | | | | | | | | | frames are used to estimate fps. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Prevent segfault if iformat was not yet initialized.Panagiotis H.M. Issaris2011-12-141-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: ulti: Fix invalid reads lavf: dealloc private options in av_write_trailer yadif: support 10bit YUV vc1: mark with ER_MB_ERROR bits overconsumption lavc: introduce ER_MB_END and ER_MB_ERROR error_resilience: use the ER_ namespace build: move inclusion of subdir.mak to main subdir loop rv34: NEON optimised 4x4 dequant rv34: move 4x4 dequant to RV34DSPContext aacdec: Use intfloat.h rather than local punning union. Conflicts: libavcodec/h264.c libavcodec/vc1dec.c libavfilter/vf_yadif.c libavformat/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: dealloc private options in av_write_trailerLuca Barbato2011-12-131-1/+1
| | | | | | | | Fix the iformat/oformat typo.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-131-1/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: doxygen: misc consistency, spelling and wording fixes vcr1: drop unnecessary emms_c() calls without MMX code Replace all uses of av_close_input_file() with avformat_close_input(). lavf: add avformat_close_input(). lavf: deprecate av_close_input_stream(). lavf doxy: add some basic demuxing documentation. lavf doxy: add some general lavf information. lavf doxy: add misc utility functions to a group. lavf doxy: add av_guess_codec/format to the encoding group. lavf doxy: add core functions to a doxy group. Add basic libavdevice documentation. lavc: convert error_recognition to err_recognition. avconv: update -map option help text x86: Require 7 registers for the cabac asm x86: bswap: remove test for bswap instruction bswap: make generic implementation more compiler-friendly h264: remove useless cast proresdec: fix decode_slice() prototype Conflicts: configure doc/APIchanges ffprobe.c libavcodec/avcodec.h libavcodec/celp_math.h libavcodec/h264.c libavfilter/src_movie.c libavformat/anm.c libavformat/avformat.h libavformat/version.h libavutil/avstring.h libavutil/bswap.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: add avformat_close_input().Anton Khirnov2011-12-121-0/+9
| | | | | | | | | | | | | | It sets the supplied AVFormatContext pointer to NULL after freeing it, which is safer and its name is consistent with other lavf functions. Also deprecate av_close_input_file().
| * lavf: deprecate av_close_input_stream().Anton Khirnov2011-12-121-1/+6
| | | | | | | | And remove all its uses.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-121-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: x86: cabac: replace explicit memory references with "m" operands avplay: don't request a stereo downmix wmapro: use av_float2int() lavc: avoid invalid memcpy() in avcodec_default_release_buffer() lavu: replace int/float punning functions lavfi: install libavfilter/vsrc_buffer.h Remove extraneous semicolons sdp: Restore the original mp4 format h264 extradata if converted rtpenc: Add support for mp4 format h264 rtpenc: Simplify code by introducing a separate end pointer movenc: Use the actual converted sample for RTP hinting Fix a bunch of common typos. Conflicts: doc/developer.texi doc/eval.texi doc/filters.texi doc/protocols.texi ffmpeg.c ffplay.c libavcodec/mpegvideo.h libavcodec/x86/cabac.h libavfilter/Makefile libavformat/avformat.h libavformat/cafdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/gxfenc.c libavformat/img2.c libavformat/movenc.c libavformat/mpegts.c libavformat/rtpenc_h264.c libavformat/utils.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Fix a bunch of common typos.Diego Biurrun2011-12-111-2/+2
| |
* | lavf: lower the log level of "parser not found".Nicolas George2011-12-081-1/+1
| | | | | | | | | | | | | | | | The information is relevant, but under normal circumstances it raises far too many false alarms. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-081-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: drawtext: remove typo pcm-mpeg: implement new audio decoding api w32thread: port fixes to pthread_cond_broadcast() from x264. doc: add editor configuration section with Vim and Emacs settings dxva2.h: include d3d9.h to define LPDIRECT3DSURFACE9 avformat/utils: Drop unused goto label. doxygen: Replace '\' by '@' in Doxygen markup tags. cosmetics: drop some completely pointless parentheses cljr: simplify CLJRContext drawtext: introduce rand(min, max) drawtext: introduce explicit draw/hide variable rtmp: Use nb_invokes for all invoke commands Conflicts: libavcodec/mpegvideo.c libavfilter/vf_drawtext.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat/utils: Drop unused goto label.Diego Biurrun2011-12-071-1/+0
| | | | | | | | libavformat/utils.c:2165:2: warning: label ‘fail’ defined but not used
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-061-15/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mov: Don't av_malloc(0). avconv: only allocate 1 AVFrame per input stream avconv: fix memleaks due to not freeing the AVFrame for audio h264-fate: remove -strict 1 except where necessary (mr4/5-tandberg). misc Doxygen markup improvements doxygen: eliminate Qt-style doxygen syntax g722: Add a regression test for muxing/demuxing in wav g722: Change bits per sample to 4 g722dec: Signal skipping the lower bits via AVOptions instead of bits_per_coded_sample api-example: update to use avcodec_decode_audio4() avplay: use avcodec_decode_audio4() avplay: use a separate buffer for playing silence avformat: use avcodec_decode_audio4() in avformat_find_stream_info() avconv: use avcodec_decode_audio4() instead of avcodec_decode_audio3() mov: Allow empty stts atom. doc: document preferred Doxygen syntax and make patcheck detect it Conflicts: avconv.c ffplay.c libavcodec/mlpdec.c libavcodec/version.h libavformat/mov.c tests/codec-regression.sh tests/fate/h264.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: use avcodec_decode_audio4() in avformat_find_stream_info()Justin Ruggles2011-12-041-15/+16
| |
* | lavf: allow grouping packets in chunks of a user specified size and duration.Michael Niedermayer2011-12-011-4/+26
| | | | | | | | | | | | This is similar to MP4Boxs -inter Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: add audio_preload option, this allows interleaving audio earlierMichael Niedermayer2011-12-011-0/+10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-011-2/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtpdec: Templatize the code for different g726 bitrate variants rv40: move loop filter to rv34dsp context lavf: make av_set_pts_info private. rtpdec: Add support for G726 audio rtpdec: Add an init function that can do custom codec context initialization avconv: make copy_tb on by default. matroskadec: don't set codec timebase. rmdec: don't set codec timebase. avconv: compute next_pts from input packet duration when possible. lavf: estimate frame duration from r_frame_rate. avconv: update InputStream.pts in the streamcopy case. Conflicts: avconv.c libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/fbdev.c libavdevice/libdc1394.c libavdevice/oss_audio.c libavdevice/v4l.c libavdevice/v4l2.c libavdevice/vfwcap.c libavdevice/x11grab.c libavformat/au.c libavformat/eacdata.c libavformat/flvdec.c libavformat/mpegts.c libavformat/mxfenc.c libavformat/rtpdec_g726.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: make av_set_pts_info private.Anton Khirnov2011-11-301-1/+9
| | | | | | | | It's supposed to be called only from (de)muxers.
| * lavf: estimate frame duration from r_frame_rate.Anton Khirnov2011-11-301-1/+4
| | | | | | | | | | If r_frame_rate is set, it should be more reliable for this than either codec or stream timebase.
| * pthread: do not touch has_b_framesJanne Grunau2011-11-221-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding the thread count in frame level multithreading to has_b_frames as an additional delay causes more problems than it solves. For example inconsistent behaviour during timestamp calculation in libavformat. Thread count and frame level multithreading are both set by the user. If the additional delay caused by frame level multithreading needs to be considered in the calling code it has all information to take it into account. Should it become necessary to calculate a maximum delay inside libavcodec it should be exported as its own field and not reusing an existing field. Based on a patch by Michael Niedermayer. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* | lavf: give more weight to the extension during probing if there is a id3Michael Niedermayer2011-11-231-3/+4
| | | | | | | | | | | | | | tag that is larger than the probe buffer. Fixes Ticket336 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: minor cleanup of av_probe_input_format3()Michael Niedermayer2011-11-231-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: cdg has large non keyframe segments and should thus be exempt from the ↵Michael Niedermayer2011-11-191-1/+1
| | | | | | | | | | | | | | | | non keyframe check in seeking. Improves seeking for cdg files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-171-3/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpegaudiodec: Don't use a nonexistent log context for av_dlog avformat: Accept the ISO8601 separate format as input, too avformat: Interpret times in ff_iso8601_to_unix_time as UTC avutil: Add av_timegm as a public function cinepak: Add another special case so that it can handle the following file: lagarith: add some RGBA decoding support lagarith: Add correct line prediction for RGB Conflicts: doc/APIchanges libavcodec/cinepak.c libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Accept the ISO8601 separate format as input, tooMartin Storsjö2011-11-161-3/+8
| | | | | | | | | | | | | | | | This makes the function accept the format of creation_time as output by demuxers (e.g. the mov demuxer), making the creation timestamp stay intact if transcoding. Signed-off-by: Martin Storsjö <martin@martin.st>
| * avformat: Interpret times in ff_iso8601_to_unix_time as UTCMartin Storsjö2011-11-161-1/+2
| | | | | | | | | | | | | | | | | | | | This function is used in muxers for parsing the 'creation_time' metadata key, for converting it to a time value. This makes it match the behaviour of the exported 'creation_time' metadata from demuxers, where it is in UTC, too. Signed-off-by: Martin Storsjö <martin@martin.st>
| * lavf: fix multiplication overflow in avformat_find_stream_info()Mans Rullgard2011-11-151-1/+1
| | | | | | | | | | | | | | Converting to double before the multiplication rather than after avoids an integer overflow in some cases. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | lavf: if timestamps are invalid (pts=dts) only drop dts.Michael Niedermayer2011-11-161-1/+1
| | | | | | | | | | | | | | Because if we drop both we have no timestamps at all for some files. Fixes Ticket344 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>