Commit Graph

101 Commits

Author SHA1 Message Date
Marton Balint 7e6b788f7c lavf/asfenc: add AVClass to context
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-05 21:32:14 +01:00
Michael Niedermayer 7c0b84d899 avformat/asfenc: Check pts
Fixes integer overflow
Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-12 19:57:14 +01:00
Michael Niedermayer d73f0c586e avformat/asfenc: Flush packet before duration becomes unrepresentable
Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov
Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-12 19:30:22 +01:00
Michael Niedermayer 30b8f3e7dc Merge commit 'b08569a23948db107e5e6175cd4c695427d5339d'
* commit 'b08569a23948db107e5e6175cd4c695427d5339d':
  lavf: Replace the ASF demuxer

Conflicts:
	Changelog
	libavformat/asf.h
	libavformat/asfdec.c
	libavformat/version.h
	tests/ref/fate/wmv8-drm-nodec
	tests/ref/seek/lavf-asf

The rewritten demuxer is placed in a new file, the current demuxer is
left as default. Carl has tested both and the one working better is
default.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-28 13:36:54 +02:00
Alexandra Hájková b08569a239 lavf: Replace the ASF demuxer
The old one is the result of the reverse engineering and guesswork.
The new one has been written following the now-available specification.

This work is part of Outreach Program for Women Summer 2014 activities
for the Libav project.

The fate references had to be changed because the old demuxer truncates
the last frame in some cases, the new one handles it properly.
The seek-test reference is changed because seeking works differently
in the new demuxer. When seeking, the packet is not read from the stream
directly, but it is rather constructed by the demuxer. That is why
position is -1 now in the reference.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-06-28 10:16:40 +02:00
Michael Niedermayer 3662e251cb avformat/asfenc: Check for index_ptr allocation failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 22:29:54 +02:00
Andreas Cadhalpun 72211a2af0 asfenc: fix leaking asf->index_ptr on error
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-03-11 20:24:59 +01:00
Andreas Cadhalpun 2c8cff2be4 asfenc: fix leaking asf->index_ptr on error
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 21:58:38 +01:00
Michael Niedermayer a0fe1a25fa Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'
* commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e':
  avformat: Don't anonymously typedef structs

Conflicts:
	libavformat/adtsenc.c
	libavformat/aiffenc.c
	libavformat/avidec.c
	libavformat/gif.c
	libavformat/iff.c
	libavformat/img2dec.c
	libavformat/jvdec.c
	libavformat/matroskadec.c
	libavformat/udp.c
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 21:07:40 +01:00
Diego Biurrun daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Paul B Mahol 12c5addebc avformat/asfenc: remove unneeded #include, there are no assert() only av_assert*
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-01-31 08:57:07 +00:00
Michael Niedermayer 4b45aa517c avformat/asfenc: replace != 0 error check by <0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 01:48:26 +01:00
Michael Niedermayer 1cf28fd5f3 avformat/asfenc: Make asf_write_indexs index argument const
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-22 18:53:44 +02:00
Aaron Graham 72dcd48c19 avformat/asfenc: honor the maximum of 63 payloads
Fixes Ticket3634

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-13 00:54:55 +02:00
Michael Niedermayer bb5657fabf Merge commit '6072184e702b4b631ac72f1b66b75e5f21e0ce2d'
* commit '6072184e702b4b631ac72f1b66b75e5f21e0ce2d':
  asfenc: use codec descriptors instead of AVCodecs to write codec info

Conflicts:
	tests/ref/lavf/asf
	tests/ref/seek/lavf-asf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01 17:40:14 +02:00
Anton Khirnov 6072184e70 asfenc: use codec descriptors instead of AVCodecs to write codec info
Also, stop using AVCodecContext.codec_name as fallback, since it will be
deprecated.

Changes the result of the lavf-asf test (and its associated seektest),
since 'msmpeg4v3' gets written instead of just 'msmpeg4'.
2014-05-01 09:26:20 +02:00
Daniel Verkamp 5e7d21c7ad ff_put_wav_header: add flag to force WAVEFORMATEX
Partially undoes commit 2c4e08d89327595f7f4be57dda4b3775e1198d5e:

    riff: always generate a proper WAVEFORMATEX structure in
    ff_put_wav_header

A new flag, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX, is added to force the
use of WAVEFORMATEX rather than PCMWAVEFORMAT even for PCM codecs.

This flag is used in the Matroska muxer (the cause of the original
change) and in the ASF muxer, because the specifications for
these formats indicate explicitly that WAVEFORMATEX should be used.

Muxers for other formats will return to the original behavior of writing
PCMWAVEFORMAT when writing a header for raw PCM.

In particular, this causes raw PCM in WAV to generate the canonical
44-byte header expected by some tools.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-30 16:41:35 +02:00
Carl Eugen Hoyos eeee59ba4d Never write 0 as maximum bitrate for asf files.
WMP refuses to play such streams.
2014-04-24 17:47:49 +02:00
Michael Niedermayer 369cdf917a avformat/asfenc: dont allow non interleaved packets
The muxer does not support this currently

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 02:49:05 +02:00
Carl Eugen Hoyos a3bd33af9e Write sample_aspect_ratio to asf files.
Fixes ticket #3528.
2014-04-17 14:55:49 +02:00
Carl Eugen Hoyos 862174ec83 Move GUID-related objects to riffenc.c and riff.c.
This simplifies the following eac3-in-wav patch.
2014-01-29 00:44:59 +01:00
Peter Ross fcbb94712d riffenc: add option to ff_put_bmp_header to ignore extradata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 15:42:35 +01:00
Michael Niedermayer 04ee57ce0a Merge commit 'bb461370e34b1fa1637f34ce7d37b934ddb472d5'
* commit 'bb461370e34b1fa1637f34ce7d37b934ddb472d5':
  asfenc: mux chapters in ASF files using an ASF "marker" section

Conflicts:
	Changelog
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-20 12:06:15 +02:00
Michael Niedermayer 018e0db5ef Merge commit '09f3c937ed6fd7c5bd64450d45f73b0f4975f4c9'
* commit '09f3c937ed6fd7c5bd64450d45f73b0f4975f4c9':
  asfenc: remember send time and offset of the index entries

Conflicts:
	libavformat/asfenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-20 11:43:32 +02:00
Michael Niedermayer c6526620a9 Merge commit 'c53b5dda352452e79a9e962cd4c74c813186d9ed'
* commit 'c53b5dda352452e79a9e962cd4c74c813186d9ed':
  asfdec: replace magic constant with DATA_HEADER_SIZE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-20 11:06:23 +02:00
Vladimir Pantelic bb461370e3 asfenc: mux chapters in ASF files using an ASF "marker" section
ASF markers only have a start time, so we lose the chapter end times,
but that is ASF for you

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:51:49 +02:00
Vladimir Pantelic 09f3c937ed asfenc: remember send time and offset of the index entries
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:37:59 +02:00
Vladimir Pantelic c53b5dda35 asfdec: replace magic constant with DATA_HEADER_SIZE
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:37:37 +02:00
Chih-Wei Huang 985920433c avformat/asfenc: fix a build error
It's introduced by the erroneous merging commit cbe47b1e.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 19:34:53 +02:00
Michael Niedermayer 2175f76894 avformat/asfenc: use av_freep() for extra saftey
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-11 13:21:11 +02:00
Michael Niedermayer cbe47b1e84 Merge commit 'f369b9356c4606cd4d713d60f7db5de119d901fa'
* commit 'f369b9356c4606cd4d713d60f7db5de119d901fa':
  avformat: Use av_reallocp_array() where suitable

Conflicts:
	libavformat/asfenc.c
	libavformat/gxfenc.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-11 11:23:40 +02:00
Alexandra Khirnova f369b9356c avformat: Use av_reallocp_array() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-10 12:38:32 +02:00
Michael Niedermayer 38665efcc7 asfenc: convert asserts to av_assert
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-07 03:59:44 +02:00
Michael Niedermayer 17ebef2fc8 Merge commit '2c328a907978b61949fd20f7c991803174337855'
* commit '2c328a907978b61949fd20f7c991803174337855':
  pixdesc: add a function for counting planes in a pixel format.
  avplay: remove the -debug option.
  Revert "asfenc: return error on negative timestamp"

Conflicts:
	doc/APIchanges
	doc/ffplay.texi
	ffplay.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 11:24:11 +01:00
Anton Khirnov 3cd93cc7b8 Revert "asfenc: return error on negative timestamp"
This reverts commit d1bec33b46, it breaks
FATE.
2013-03-19 11:04:55 +01:00
Michael Niedermayer 523c8e0503 Merge commit '50c449ac24fbb4c03c15d2e2026cef2204b80385'
* commit '50c449ac24fbb4c03c15d2e2026cef2204b80385':
  iff: validate CMAP palette size
  asfenc: return error on negative timestamp

Conflicts:
	libavformat/iff.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 17:30:53 +01:00
Luca Barbato d1bec33b46 asfenc: return error on negative timestamp
According to the specification the timestamp is represented by a 32bit
unsigned.

CC: libav-stable@libav.org
2013-03-18 10:48:23 +01:00
Michael Niedermayer fadf845973 Merge commit '48a4ffa722c0874b251de9d201babed52cef0bcb'
* commit '48a4ffa722c0874b251de9d201babed52cef0bcb':
  asf: K&R formatting cosmetics
  vc1dec: use codec_id instead of codec_tag for VC1IMAGE
  sh4: drop unused functions

Conflicts:
	libavformat/asf.c
	libavformat/asfdec.c
	libavformat/asfenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 14:25:28 +01:00
Diego Biurrun 48a4ffa722 asf: K&R formatting cosmetics 2013-02-06 09:48:51 +01:00
Michael Niedermayer b4c753487c asfenc: avoid negative timestamps
Fixes Ticket1606

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-28 02:40:53 +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
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
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
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 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 d1dad7c824 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpc8: return more meaningful error codes.
  mpc: return more meaningful error codes.
  wv,mpc8: don't return apetag data in packets.
  rtmp: do not warn about receiving metadata packets
  x86: h264dsp: Adjust YASM #ifdefs
  x86: yadif: Mark mmxext optimizations as such
  h264: convert loop filter strength dsp function to yasm.
  Improve descriptiveness of a number of codec and container long names

Conflicts:
	libavcodec/flvdec.c
	libavcodec/libopenjpegdec.c
	libavformat/apetag.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-31 22:41:00 +02:00
Diego Biurrun 0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Ronald S. Bultje fd48721849 lavf: use conditional notation for default codec in muxer declarations.
This removes the use of macro nesting in these code constructs, which
makes it easier to parse in pre-processors.
2012-07-22 16:10:21 -07:00
Michael Niedermayer 2e0c360abd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  cosmetics: Align muxer/demuxer declarations
  mpeg12: Do not change frame_pred_frame_dct flag and demote error into a warning
  avcodec: remove avcodec_guess_channel_layout()
  avutil: Add av_get_default_channel_layout()

Conflicts:
	doc/APIchanges
	libavcodec/mpeg12.c
	libavformat/cdg.c
	libavformat/matroskaenc.c
	libavformat/mpegts.c
	libavformat/nuv.c
	libavformat/wav.c
	libavutil/audioconvert.c
	libavutil/audioconvert.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-06 22:52:01 +02:00