aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* lavf: check that the context to avformat_open_input() is valid.Michael Niedermayer2012-04-181-0/+4
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Add skip_to_keyframe stream variable.Reimar Döffinger2012-04-161-0/+6
| | | | | | | | | | | | This replaces the matroskadec one with the same name. The advantage is not only easier reuse in other demuxers but also that we can make the decisions after the parser. This fixes seeking in files that mark the keyframes incorrectly, for example the file in track ticket #1003. The matroska variable is still kept to be able to complain about such broken files. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-04-141-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: vsrc_buffer: fix check from 7ae7c41. libxvid: Reorder functions to avoid forward declarations; make functions static. libxvid: drop some pointless dead code wmal: vertical alignment cosmetics wmal: Warn about missing bitstream splicing feature and ask for sample. wmal: Skip seekable_frame_in_packet. wmal: Drop unused variable num_possible_block_size. avfiltergraph: make the AVFilterInOut alloc/free API public graphparser: allow specifying sws flags in the graph description. graphparser: fix the order of connecting unlabeled links. graphparser: add avfilter_graph_parse2(). vsrc_buffer: allow using a NULL buffer to signal EOF. swscale: handle last pixel if lines have an odd width. qdm2: fix a dubious pointer cast WMAL: Do not try to read rawpcm coefficients if bits is invalid mov: Fix detecting there is no sync sample. tiffdec: K&R cosmetics avf: has_duration does not check the global one dsputil: fix optimized emu_edge function on Win64. Conflicts: doc/APIchanges libavcodec/libxvid_rc.c libavcodec/libxvidff.c libavcodec/tiff.c libavcodec/wmalosslessdec.c libavfilter/avfiltergraph.h libavfilter/graphparser.c libavfilter/version.h libavfilter/vsrc_buffer.c libswscale/output.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avf: has_duration does not check the global oneLuca Barbato2012-04-131-0/+2
| | | | | | | | | | Some container formats report a global duration, but not a per stream one.
* | lavf: print with debug level the byte positions before and after ↵Michael Niedermayer2012-04-141-0/+5
| | | | | | | | | | | | find_stream_info Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: compute_pkt_fields, limit the pts upcorrection to mpegMichael Niedermayer2012-04-121-1/+4
| | | | | | | | | | | | | | The pts correction conflicts with the ogg vorbis demuxer. Thanks-to: Justin Ruggles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: always call avio_flush in av_write_trailer.Reimar Döffinger2012-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | Otherwise for muxers like e.g. latmenc that never call avio_flush (and do not have a write_trailer function) a part of the data will always be missing. Also update references for the voc muxer, which was also buggy before and did not write out all data. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-04-071-1/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtpdec_asf: Set the no_resync_search option for the chained asf demuxer asfdec: Add an option for not searching for the packet markers cosmetics: Clean up the tiffenc pix_fmts declaration to match the style of others cosmetics: Align codec declarations cosmetics: Convert mimic.c to utf-8 avconv: remove an unused function parameter. avconv: remove now pointless variables. avconv: drop support for building without libavfilter. nellymoserenc: fix crash due to memsetting the wrong area. libavformat: Only require first packet to be known for audio/video streams avplay: Don't try to scale timestamps if the tb isn't set Conflicts: Changelog configure ffmpeg.c libavcodec/aacenc.c libavcodec/bmpenc.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/ffv1.c libavcodec/flacenc.c libavcodec/fraps.c libavcodec/huffyuv.c libavcodec/libopenjpegdec.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/pamenc.c libavcodec/pgssubdec.c libavcodec/pngenc.c libavcodec/qtrleenc.c libavcodec/rawdec.c libavcodec/sgienc.c libavcodec/tiffenc.c libavcodec/v210dec.c libavcodec/wmv2dec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Only require first packet to be known for audio/video streamsJoakim Plate2012-04-061-1/+3
| | | | | | | | | | | | | | | | It can take a long time before subtitles or data streams show up, so we shouldn't wait for those before assuming we have all info for streams. Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavf: Fix the last PTS to be generated using -fflags +genptsThierry Foucu2012-04-051-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | To reproduce the problem, using ffprobe: ./ffprobe -show_packets -print_format compact -fflags +genpts -i fate_samples/mxf/C0023S01.mxf You will notice that the last video frame does not have it's PTS being set, even with using genpts. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Add AVIO_FLAG_DIRECT.Reimar Döffinger2012-04-041-1/+1
| | | | | | | | | | | | | | | | Allows avoiding the buffer when using avio read, write and seek functions. When using the ffmpeg executable -avioflags direct can be used to enable this mode for input files, but has no effect on output files. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | lavf: add mp1/2 to determinable_frame_size()Michael Niedermayer2012-04-041-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: print some more things in TS debug statementsMichael Niedermayer2012-04-031-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: increase RELATIVE_TS_BASEMichael Niedermayer2012-04-031-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: print ts values in pts < dts error messageMichael Niedermayer2012-03-291-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-291-2/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: asf: only set index_read if the index contained entries. cabac: add overread protection to BRANCHLESS_GET_CABAC(). cabac: increment jump locations by one in callers of BRANCHLESS_GET_CABAC(). cabac: remove unused argument from BRANCHLESS_GET_CABAC_UPDATE(). cabac: use struct+offset instead of memory operand in BRANCHLESS_GET_CABAC(). h264: add overread protection to get_cabac_bypass_sign_x86(). h264: reindent get_cabac_bypass_sign_x86(). h264: use struct offsets in get_cabac_bypass_sign_x86(). h264: fix overreads in cabac reader. wmall: fix seeking. lagarith: fix buffer overreads. dvdec: drop unnecessary dv_tablegen.h #include build: fix doc generation errors in parallel builds Replace memset(0) by zero initializations. faandct: Remove FAAN_POSTSCALE define and related code. dvenc: print allowed profiles if the video doesn't conform to any of them. avcodec_encode_{audio,video}: only reallocate output packet when it has non-zero size. FATE: add a test for vp8 with changing frame size. fate: add kgv1 fate test. oggdec: calculate correct timestamps in Ogg/FLAC Conflicts: libavcodec/4xm.c libavcodec/cook.c libavcodec/dvdata.c libavcodec/dvdsubdec.c libavcodec/lagarith.c libavcodec/lagarithrac.c libavcodec/utils.c tests/fate/video.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace memset(0) by zero initializations.Diego Biurrun2012-03-281-2/+1
| | | | | | | | Also remove one pointless zero initialization in rangecoder.c.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-271-12/+18
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: make av_interleaved_write_frame() flush packets when pkt is NULL mpegts: Fix dead error checks vc1: Do not read from array if index is invalid. targa: convert to bytestream2. rv34: set mb_num_left to 0 after finishing a frame Conflicts: libavcodec/targa.c libavcodec/vc1data.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * make av_interleaved_write_frame() flush packets when pkt is NULLJindrich Makovicka2012-03-271-12/+18
| | | | | | | | | | | | | | | | This patch allows the user to force flushing of all queued packets by calling av_interleaved_write_frame() with pkt set to NULL. Signed-off-by: Jindrich Makovicka <jindrich.makovicka@nangu.tv> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Handle 0-size sync packets when only parsing headers.Reimar Döffinger2012-03-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Currently, the duration of those packets is just discarded when enabling parsing, thus the output of the Metal Gear Solid demuxer breaks completely when just setting AVSTREAM_PARSE_HEADERS. The result will not be correct if a parser creates a delay even with PARSER_FLAG_COMPLETE_FRAMES and there might be other cases where it does not work correct, but just discarding them as it is done currently seems worse. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Print a warning when using wild guesses as time stamps.Reimar Döffinger2012-03-211-0/+5
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-211-16/+56
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (27 commits) avconv: free packet in write_frame() when discarding due to frame number limit FATE: use +/- flag option syntax for vp8 emu-edge tests lavf: make av_interleave_packet_per_dts() private. lavf: deprecate av_read_packet(). oggdec: output correct timestamps for Vorbis avconv: pass input stream timestamps to audio encoders lavc: shrink encoded audio packet size after encoding. xa: set correct bit rate xa: do not set bit_rate, block_align, or bits_per_coded_sample xa: fix end-of-file handling xa: fix timestamp calculation bink: fix typo in FFALIGN() argument bink: align plane width to 8 when calculating bundle sizes doc: pass -Idoc texi2html and texi2pod doc: texi2pod: add -I flag movenc: Add a min_frag_duration option rtsp: Set the default delay to 0.1 s for the RTSP/SDP/RTP demuxers libavformat: Set the default for the max_delay option to -1 Generate manpages for AV{Format,Codec}Context AVOptions. doc/avconv: remove entries for AVOptions. ... Conflicts: doc/Makefile doc/ffmpeg.texi doc/muxers.texi ffmpeg.c libavcodec/Makefile libavcodec/options.c libavcodec/vp8.c libavformat/options.c tests/fate/demux.mak tests/ref/fate/truemotion1-15 tests/ref/fate/truemotion1-24 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: make av_interleave_packet_per_dts() private.Anton Khirnov2012-03-201-2/+12
| | | | | | | | | | There is no reason for it to be public, it's only meant to be used internally.
| * lavf: deprecate av_read_packet().Anton Khirnov2012-03-201-4/+12
| | | | | | | | | | | | The caller can achieve the same effect (i.e. getting raw unparsed/mangled packets) with av_read_frame() and AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN
| * lavf: use AVStream.discard to disable queueing attached pictures.Anton Khirnov2012-03-201-1/+2
| |
| * lavf: requeue attached pictures after seeking.Anton Khirnov2012-03-201-10/+31
| | | | | | | | | | This allows the caller to get them without special code even after seeking before receiving any data.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-201-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (35 commits) fix space type in Changelog ZeroCodec Decoder RealAudio Lossless decoder rtpenc: Use AVFormatContext.packet_size instead of a private option url: Document the expected behaviour of url_read libavformat: Use AVFormatContext.probesize in init_input docs: Fix a stray reference to tags in the generic doxy on dicts cosmetics: Align some AVInput/OutputFormat declarations zmbv: check decompress result zmbv: correct indentation adpcm: convert adpcm_thp to bytestream2. adpcm: convert adpcm_yamaha to bytestream2. adpcm: convert adpcm_swf to bytestream2. adpcm: convert adpcm_sbpro to bytestream2. adpcm: convert adpcm_ct to bytestream2. adpcm: convert adpcm_ima_amv/smjpeg to bytestream2. adpcm: convert adpcm_ea_xas to bytestream2. adpcm: convert adpcm_ea_r1/2/3 to bytestream2. adpcm: convert ea_maxis_xa to bytestream2. adpcm: convert adpcm_ea to bytestream2. ... Conflicts: Changelog libavcodec/Makefile libavcodec/adpcm.c libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/version.h libavcodec/zerocodec.c libavcodec/zmbv.c libavformat/riff.c libavformat/url.h tests/ref/fate/truemotion1-15 tests/ref/fate/truemotion1-24 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Use AVFormatContext.probesize in init_inputMartin Storsjö2012-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This was forgotten in the transition from av_open_input_file to avformat_open_input, see 603b8bc2a1. This doesn't change anything for the default case where the option isn't set, since PROBE_BUF_MAX is 1048576 (which was used as max probe size earlier) while the default value for the probesize option is 5000000, which for the probe function is clipped to PROBE_BUF_MAX anyway. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-181-40/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: fate: make compare() function compatible with POSIX bc Update Janne's email address. APIchanges: Replace Subversion revision numbers by Git hashes. bytestream: Eliminate one level of pointless macro indirection. xwd: convert to bytestream2. vqavideo: port to bytestream2 API Read preset files with suffix .avpreset prores: allow user to set fixed quantiser lavf: remove some disabled code. lavf: only set average frame rate for video. lavf: remove a pointless check. avcodec: add XBM encoder Conflicts: Changelog cmdutils.c cmdutils.h doc/APIchanges libavcodec/Makefile libavcodec/avcodec.h libavcodec/version.h libavcodec/vqavideo.c libavformat/img2enc.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: remove some disabled code.Anton Khirnov2012-03-171-36/+0
| |
| * lavf: only set average frame rate for video.Anton Khirnov2012-03-171-4/+4
| |
| * lavf: remove a pointless check.Anton Khirnov2012-03-171-1/+1
| | | | | | | | Timebase is already checked in avpriv_set_pts_info().
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-161-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: dxa: remove useless code lavf: don't select an attached picture as default stream for seeking. avconv: remove pointless checks. avconv: check for get_filtered_frame() failure. avconv: remove a pointless check. swscale: convert hscale() to use named arguments. x86inc: add *mp named argument support to DEFINE_ARGS. swscale: convert hscale to cpuflags(). Conflicts: ffmpeg.c libswscale/x86/scale.asm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: don't select an attached picture as default stream for seeking.Anton Khirnov2012-03-151-1/+2
| |
* | lavf: Add system to seperate relative timestamps from absolute ones.Michael Niedermayer2012-03-091-17/+39
| | | | | | | | | | | | | | | | | | With this we can always know if a timestamp is based on added durations from an unknown origin or if it is based on a correct timestamp (and possibly added durations) This should fix some bugs where this distinction was mixed up. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat_new_stream: fix initial last_dts valueMichael Niedermayer2012-03-081-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-061-244/+294
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (31 commits) cdxl demux: do not create packets with uninitialized data at EOF. Replace computations of remaining bits with calls to get_bits_left(). amrnb/amrwb: Remove get_bits usage. cosmetics: reindent avformat: do not require a pixel/sample format if there is no decoder avformat: do not fill-in audio packet duration in compute_pkt_fields() lavf: Use av_get_audio_frame_duration() in get_audio_frame_size() dca_parser: parse the sample rate and frame durations libspeexdec: do not set AVCodecContext.frame_size libopencore-amr: do not set AVCodecContext.frame_size alsdec: do not set AVCodecContext.frame_size siff: do not set AVCodecContext.frame_size amr demuxer: do not set AVCodecContext.frame_size. aiffdec: do not set AVCodecContext.frame_size mov: do not set AVCodecContext.frame_size ape: do not set AVCodecContext.frame_size. rdt: remove workaround for infinite loop with aac avformat: do not require frame_size in avformat_find_stream_info() for CELT avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3 avformat: do not require frame_size in avformat_find_stream_info() for AAC ... Conflicts: doc/APIchanges libavcodec/Makefile libavcodec/avcodec.h libavcodec/h264.c libavcodec/h264_ps.c libavcodec/utils.c libavcodec/version.h libavcodec/x86/dsputil_mmx.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: reindentJustin Ruggles2012-03-051-5/+5
| |
| * avformat: do not require a pixel/sample format if there is no decoderJustin Ruggles2012-03-051-13/+29
| | | | | | | | | | | | | | | | Also, do not keep trying to find and open a decoder in try_decode_frame() if we already tried and failed once. Fixes always searching until max_analyze_duration in avformat_find_stream_info() when demuxing codecs without a decoder.
| * avformat: do not fill-in audio packet duration in compute_pkt_fields()Justin Ruggles2012-03-051-14/+33
| | | | | | | | Use the estimated duration only to calculate missing timestamps if needed.
| * lavf: Use av_get_audio_frame_duration() in get_audio_frame_size()Justin Ruggles2012-03-051-19/+14
| | | | | | | | | | | | | | | | | | | | Also, do not give AVCodecContext.frame_size priority for muxing. Updated 2 FATE references: dxa-feeble - adds 1 audio frame that is still within 2 seconds as specified by -t 2 in the FATE test wmv8-drm-nodec - durations are not needed. previously they were estimated using the packet size and average bit rate.
| * avformat: do not require frame_size in avformat_find_stream_info() for CELTJustin Ruggles2012-03-051-3/+0
| | | | | | | | | | In Ogg/CELT, frame_size is found in the same place as the sample_rate and channels, so we do not need to force the frame_size to be parsed.
| * avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3Justin Ruggles2012-03-051-3/+0
| | | | | | | | | | It was only needed to avoid a bad time base (and thus non-monotone timestamps) for stream copy to avi.
| * avformat: do not require frame_size in avformat_find_stream_info() for AACJustin Ruggles2012-03-051-1/+0
| | | | | | | | We already will get the needed info because of CODEC_CAP_CHANNEL_CONF
| * lavf: deobfuscate read_frame_internal().Anton Khirnov2012-03-051-146/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Split off packet parsing into a separate function. Parse full packets at once and store them in a queue, eliminating the need for tracking parsing state in AVStream. The horrible unreadable loop in read_frame_internal() now isn't weirdly ordered and doesn't contain evil gotos, so it should be much easier to understand. compute_pkt_fields() now invents slightly different timestamps for two raw vc1 tests, due to has_b_frames being set a bit later. They shouldn't be more wrong (or right) than previous ones.
| * lavf: make read_from_packet_buffer() more flexible.Anton Khirnov2012-03-051-12/+20
| | | | | | | | | | | | | | | | Make packet buffer a parameter, don't hardcode it to be AVFormatContext.packet_buffer. Also move the function higher in the file, since it will be called from read_frame_internal().
| * lavf: factorize freeing a packet buffer.Anton Khirnov2012-03-051-17/+13
| |
* | libutvideo: Add Ut Video encoder wrapperDerek Buitenhuis2012-03-051-0/+1
| | | | | | | | | | | | | | | | | | All colorspaces are supported. Renamed libutvideo.cpp to libutvideodec.cpp. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: Do not compute the packet duration based on the bitrate if the ↵Michael Niedermayer2012-03-041-1/+1
| | | | | | | | | | | | | | | | | | frame_size can be determined. This fixes issues when the bitrate is variable or inaccurate but the frame size has not been determined yet. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf: factor out determinable_frame_size()Michael Niedermayer2012-03-041-6/+12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>