Commit Graph

1215 Commits

Author SHA1 Message Date
Michael Niedermayer 406cdddbdd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libx264: add forgotten ;
  matroskadec: fix a sanity check.
  matroskadec: only return corrupt packets that actually contain data
  lavf: zero data/size of the packet passed to read_packet().
  ARM: use 2-operand syntax for ADD Rd, PC in Apple PIC code
  ARM: align PIC offset pools to 4 bytes
  ARM: swap source operands in some add instructions
  configure: update tms470 detection for latest version
  lavf probe: prevent codec probe with no data at all seen
  motion_est: fix use of inline on extern functions

Conflicts:
	libavcodec/motion_est_template.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-21 14:44:32 +02:00
Anton Khirnov 1cc569ddda lavf: zero data/size of the packet passed to read_packet(). 2012-09-21 09:14:37 +02:00
Janne Grunau 6746cd7f61 lavf probe: prevent codec probe with no data at all seen
This occurs with fuzzed mpeg-ts files. set_codec_from_probe_data() is
called with a zeroed AVProbeData since no packet made through for
specific stream.
2012-09-20 14:50:06 +02:00
Reimar Döffinger 07d2d06395 Remove code that duplicates existing code a few lines down.
This also fixes a potential crash since s->pb can be NULL.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-09-17 21:17:43 +02:00
Michael Niedermayer f276a490f0 Merge commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b'
* commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b':
  avformat: fix typo in avformat_close_input
  mp3enc: write Xing TOC
  mp3enc: support MPEG-2 and MPEG-2.5 in Xing header.
  mp3enc: downgrade some errors in writing Xing frame to warnings
  lavf: flush the output AVIOContext in av_write_trailer().
  lavf: cosmetics, reformat av_write_trailer().
  avio: flush the internal buffer in avio_close()
  Enhance doc on asyncts audiofilter
  cmdutils: avoid setting data pointers to invalid values in alloc_buffer()
  libavcodec: remove av_destruct_packet_nofree()

Conflicts:
	libavcodec/avpacket.c
	libavformat/mp3enc.c
	libavformat/nutenc.c
	libavformat/utils.c
	libavformat/version.h
	tests/ref/lavf/voc
	tests/ref/lavf/voc_s16

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-16 14:24:11 +02:00
Luca Barbato 3f7fd59d15 avformat: fix typo in avformat_close_input
The condition should not be &&.
2012-09-15 20:23:39 +02:00
Anton Khirnov 3b4bb19e63 lavf: flush the output AVIOContext in av_write_trailer().
This is consistent with stdio and is what we want to do in all cases.

Fixes a bug in the voc muxer which didn't flush in write_trailer()
previously. This is the cause of the change in the test results.
2012-09-15 18:25:07 +02:00
Anton Khirnov 0c270239c2 lavf: cosmetics, reformat av_write_trailer(). 2012-09-15 18:24:59 +02:00
Michael Niedermayer f1ca40ee00 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  riff: Add SVQ3 fourcc
  fate: ac3: add 4.0 and downmix tests
  configure: x86: improve ebp availability check
  vorbisdec: ensure FASTDIV denominator is never 1
  avformat: refactor avformat_close_input
  avformat: simplify avformat_close_input

Conflicts:
	configure
	libavcodec/vorbisdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-15 10:35:26 +02:00
Michael Niedermayer e2d643efcd lavf/compute_pkt_fields: only run pts by duration correction if reference ts is available
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-14 19:47:41 +02:00
Luca Barbato 44272c1ccc avformat: refactor avformat_close_input
Do not crash if the input format is not allocated yet.
2012-09-14 14:26:27 +02:00
Luca Barbato 4d1f443c3d avformat: simplify avformat_close_input
avio_close checks by itself for NULL condition.
2012-09-14 14:26:27 +02:00
Michael Niedermayer 062091f87f compute_pkt_fields2: dont interpret max_b_frames of <0 as there being b frames.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-14 02:30:00 +02:00
Michael Niedermayer 8470e6c96f lavf/avformat_seek_file: fix harmless integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-11 03:02:51 +02:00
Michael Niedermayer 41dba453f9 utils/update_stream_timings: fix division by zero
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-10 16:57:31 +02:00
Michael Niedermayer b422e2c58a compute_pkt_fields: fix harmless integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-10 16:15:07 +02:00
Michael Niedermayer 8a0118b4b4 ffio_read: dont spam the user at EOF with a truncation error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-08 12:41:57 +02:00
Stefano Sabatini 25f139e72f lavf/utils: fix typo in has_codec_parameters
Replace "unspecified sample size" with "unspecified frame size". +10l.
2012-09-07 14:31:37 +02:00
Michael Niedermayer a7fbc7d7b7 lavf: factor codec id forcing out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-07 13:16:04 +02:00
Stefano Sabatini 29e972f67c lavu/parseutils: add av_small_strptime()
Make internal small_strptime() function public, and use it in place of
strptime().
This allows to avoid a dependency on strptime() on systems which do not
support it.

In particular, fix trac ticket #992.
2012-09-06 00:40:01 +02:00
Clément Bœsch 5620088494 lavf: fix a few typo in some comments. 2012-09-05 23:22:35 +02:00
Clément Bœsch 9d9f34a3c1 lavf: remove a few useless AV_NOWARN_DEPRECATED().
read_seek was undeprecated in e5c708151.
2012-09-05 23:18:07 +02:00
Michael Niedermayer 19d8954966 find_stream_info: update last_dts more often
This improves dts validity checks and consequently fps detection of files with invalid dts
Fixes Ticket1681

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-30 23:48:54 +02:00
Michael Niedermayer 12b1512e85 lavf/utils: Try to unwrap pts/dts so as to minimize wraps
Based on code by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-24 03:08:51 +02:00
Michael Niedermayer 254917f078 lavf/utils: run update_initial_timestamps() outside some if()
This way it gets executed earlier and updated timestamps become available earlier.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-24 03:07:03 +02:00
Clément Bœsch 26ec392a0e lavf: remove unused AVStream pointer. 2012-08-21 13:48:08 +02:00
Clément Bœsch 3dba9e19c8 lavf: add const qualifier to AVCodecDescriptor pointer in is_intra_only().
Fix "assignment discards ‘const’ qualifier from pointer target type" warnings.
2012-08-21 13:47:43 +02:00
Michael Niedermayer 85a576775e lavf: factor ff_free_stream() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-21 06:13:54 +02:00
Michael Niedermayer c9fe864472 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  vorbisdec: remove some pointless comments
  avprobe: add const to AVCodec pointer
  libavformat: add const to AVCodec pointers
  pthread: add const to AVCodec pointers

Conflicts:
	ffprobe.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-19 14:55:58 +02:00
Michael Niedermayer 28ff17fa97 lavf: add use_wallclock_as_timestamps
This may fix Ticket730

Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-18 19:19:47 +02:00
Mans Rullgard edb5238ccb libavformat: add const to AVCodec pointers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-18 14:20:57 +01:00
Michael Niedermayer 11f8f2c0f3 avformat: export queue_attached_pictures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 04:37:55 +02:00
Andrey Utkin aec9390a9d Check for avio fail in avformat_write_header, av_write_frame
With minor changes by michael
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-14 16:25:53 +02:00
Nicolas George b1511e00f6 lavf: probe PGS subtitles definition.
The resolution is in the packets, so decoding must happen.
Since most other formats do not set the dimension, make it
a special case for PGS. If other codecs were to have the
same requirement, using a CODEC_CAP would be preferred.
2012-08-14 11:17:45 +02:00
Michael Niedermayer d5c90ff23b lavf: reimplement is_intra_only() by using the AVCodecContext codec descriptor
This also changes behavior as the descriptor table is more complete than
the switch/case it replaces. As well as considering all non video as
intra only

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-12 14:51:22 +02:00
Michael Niedermayer d0bf3bf1ff Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: Detect discontinuities in timestamps for framerate/analyzeduration calculation
  lavf: Initialize the stream info timestamps in avformat_new_stream
  id3v2: Match PIC mimetype/format case-insensitively
  configure: Rename check_asm() to more fitting check_inline_asm()
  fate: Only test enabled filters
  avresample: De-doxygenize some comments where Doxygen is not appropriate
  rtmp: split chunk_size var into in_chunk_size and out_chunk_size
  rtmp: Factorize the code by adding find_tracked_method

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-12 13:43:03 +02:00
Martin Storsjö bdefe22b8e lavf: Detect discontinuities in timestamps for framerate/analyzeduration calculation
If the dts difference is more than 1000 times the average dts
difference, restart the analysis.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-12 12:39:49 +03:00
Martin Storsjö 30c26c2442 lavf: Initialize the stream info timestamps in avformat_new_stream
These are normally initialized to AV_NOPTS_VALUE at the start
of avformat_find_stream_info, but if a new stream is found while
this function is running (e.g. like in mpegts), the newly added
AVStreams didn't have these values properly initalized, leading
to avformat_find_stream_info terminating too soon (when the
first timestamps are far from 0).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-12 12:39:47 +03:00
Michael Niedermayer a036ac5782 lavf: do not discard correct dts in favor of wrong pts for vc1-wmapro.ism
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-12 00:52:20 +02:00
Michael Niedermayer f5f3684fb8 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: simplify is_intra_only() by using codec descriptors.
  lavc: add an intra-only codec property.
  lavc: add codec descriptors.
  lavc: fix mixing CODEC_ID/AV_CODEC_ID in C++ code.
  dict: move struct AVDictionary definition to dict.c
  dict: add av_dict_count()

Conflicts:
	doc/APIchanges
	libavcodec/old_codec_ids.h
	libavformat/utils.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-11 15:01:45 +02:00
Anton Khirnov 885da7b082 lavf: simplify is_intra_only() by using codec descriptors. 2012-08-11 11:34:24 +02:00
Mans Rullgard 987170cb9d dict: add av_dict_count()
This adds a function to retrieve the number of entries in a
dictionary and updates the places directly accessing what should
be an opaque struct to use this new function instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 15:15:00 +01:00
Michael Niedermayer b615dbb319 lavf: block special characters in dump metadata
This is limited to the chars that arent filtered by av_log() already
we might filter more aggressively if theres some case where this becomes
needed.

Fixes Ticket1181

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-08 21:13:15 +02:00
Michael Niedermayer 7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer 7ae473e8a0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  nuv: K&R formatting cosmetics
  build: generalise rules and variable settings for av* programs
  nuv: check RTjpeg header for validity
  Revert "nuv: check per-frame header for validity."
  imc: remove unused field IMCContext.one_div_log2
  imc: fix size of a memset()
  imc: remove empty if() block
  fate: simplify variable setting filter.mak
  lavf: Declare an AVRational struct without a struct literal

Conflicts:
	Makefile
	configure
	libavcodec/nuv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 22:22:37 +02:00
Clément Bœsch 16dc5f2050 Replace various inlined inverse AVRational with av_inv_q(). 2012-08-06 00:04:36 +02:00
Martin Storsjö 6c071a2b38 lavf: Declare an AVRational struct without a struct literal
At this place, the normal way of initializing a struct works
fine, there's no need for a struct literal.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-06 00:48:58 +03:00
Michael Niedermayer 3e1cf49676 compute_pkt_fields: do not attempt to calculate dts when the delay hasnt been estimated.
Fixes ticket1242

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-04 15:42:44 +02:00
Michael Niedermayer 2107009e7d lavf: move nb_decoded_frames out of info.
This way the variable is available outside find_stream_info

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-04 15:42:44 +02:00