Commit Graph

239 Commits

Author SHA1 Message Date
Nigel Touati-Evans 42bd0cd21a Fix copying extradata to codec in mxfdec.c
The code that copies any extradata from the MXFDescriptor to the codec does
not set the size, which it should otherwise the copied data is useless.
Attached it a patch to correct this.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-27 13:32:48 +02:00
Michael Niedermayer efc08e00cc Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'
* commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110':
  vf_aspect: use the name 's' for the pointer to the private context
  Remove commented-out debug #define cruft

Conflicts:
	libavcodec/4xm.c
	libavcodec/dvdsubdec.c
	libavcodec/ituh263dec.c
	libavcodec/mpeg12.c
	libavfilter/avfilter.c
	libavfilter/vf_aspect.c
	libavfilter/vf_fieldorder.c
	libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-16 09:56:43 +02:00
Diego Biurrun 2832ea26f3 Remove commented-out debug #define cruft 2013-05-16 00:23:30 +02:00
Joseph Artsimovich 3967f68053 Better handling for MXF essence reading reaching EOF.
If no metadata follows MXF essence, that is essence ends with EOF,
"Operation not permitted" error was produced and a non-zero code
was returned from ffmpeg executable.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-13 19:03:04 +02:00
Michael Niedermayer 578d9cf7cc mxf_timestamp_to_str: dont leave uninitilaized fields in time.
Fixes CID1005318
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-21 00:26:20 +02:00
Marton Balint 007989c7a2 mxfdec: fix return variable type for avio_seek
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-19 01:29:35 +02:00
Hendrik Leppkes 423089e964 lavf/mxfdec: validate month/day before date formatting
Some implementations of strftime do not like invalid values for
month/day, so ensure it doesn't happen.

Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-13 18:07:08 +02:00
Matthieu Bouron c8b3644494 lavf/mxf: fix parsing of timestamps
Correct bit mask for month/day/hour/min/sec values.

For reference the timestamp format specified in S377M is as follow:
  year (int16), month (uint8), day (uint8), hour (uint8), sec (uint8),
  msec (uint8).
A value of 0 for every fields means timestamp "unknown".

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-13 17:26:16 +02:00
Hendrik Leppkes 8da2a3aba3 lavf/mxfdec: use more widely supported time format string
MSVC lacks support for %T and %F, but the standard specifies them
only as shorthands to the long variants.

Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-13 16:45:56 +02:00
Hendrik Leppkes cac309611c lavf/mxf: fix parsing of the month from mxf timestamps
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-13 16:02:52 +02:00
Marton Balint f1e606c762 mxfdec: update current edit unit when seeking in mxf files without index tables
Fixes audio packet pts values in some files generated by AVID TRMG 3.01.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-11 13:35:58 +02:00
Matthieu Bouron 25b143aa7b lavf/mxfdec: handle identification metadata 2013-04-08 11:16:56 +02:00
Matthieu Bouron 69e93792d6 lavf/mxfdec: read field dominance flag
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-19 03:01:51 +01:00
Michael Niedermayer a9ddb62489 Merge commit '1ecdf8912b9ced51b3267cdcdce5e394d0a3bf8e'
* commit '1ecdf8912b9ced51b3267cdcdce5e394d0a3bf8e':
  avformat: av_log_ask_for_sample() ---> avpriv_request_sample()

Conflicts:
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 12:41:34 +01:00
Diego Biurrun 1ecdf8912b avformat: av_log_ask_for_sample() ---> avpriv_request_sample() 2013-03-13 20:42:21 +01:00
Nicolas George b52421940f lavf: add AV_ to two remaining CODEC_ID_*. 2013-03-12 16:21:22 +01:00
Carl Eugen Hoyos d714576037 Use SMPTE standard notation when showing mxf Universal Labels. 2013-02-21 09:11:22 +01:00
Carl Eugen Hoyos 182e342fdb Print mxf Universal Label if the user requested verbose logging.
Fixes ticket #2198
2013-02-11 13:11:16 +01:00
Michael Niedermayer e5e422bcc3 mxfdec: Fix integer overflow with many channels
Fixes division by zero

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-11 17:42:04 +01:00
Xi Wang 3b81bba3bc mxfdec: fix NULL checking in mxf_get_sorted_table_segments()
The following out-of-memory check is broken.

    *sorted_segments  = av_mallocz(...);
    if (!sorted_segments) { ... }

The correct NULL check should use *sorted_segments.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-01-04 20:43:42 -05:00
Reimar Döffinger c5142a95a5 Support more AVC-Intra files
Followup to http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/151321
patch by Reimar and Thomas Mundt fixes some AVC-Intra files from
different tickets.
It does not fix http://samples.ffmpeg.org/ffmpeg-
bugs/trac/ticket524/AVCI50.mov

Authors of this commit are: Reimar and Thomas Mundt
Patch and commit message mostly taken from ffmpeg-devel, mail by Carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-03 21:48:38 +01:00
Reimar Döffinger def01739c1 mxfdec: Set AV_FIELD_PROGRESSIVE, needed for AVC-intra
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-03 21:44:33 +01:00
Tomas Härdin 928727f951 mxfdec: Rescale audio stream duration from EditRate to SampleRate
Since 83cab07 audio stream time bases are based on SampleRate, not EditRate.
This fixes trac ticket #2029 and a few seeking issues.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-25 17:45:34 +01:00
Michael Niedermayer 59693ed96c mxf_probe: make buffer related pointers const
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-25 01:54:20 +01:00
Michael Niedermayer 75b3911e5a mxf_set_audio_pts: fix division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-12 11:35:47 +01:00
Michael Niedermayer 7d05bbb656 mxfdec: drop unneeded extradata padding
Found-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-11 16:40:28 +01:00
Michael Niedermayer b65570808c mxfdec: fix leak of extradata
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-11 14:43:47 +01:00
Michael Niedermayer 9f92e590ba mxfdec: fix double free
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-09 11:46:26 +01:00
Michael Niedermayer 873049e6d8 mxfdec: check index_tables before dereferencing in close.
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-01 20:19:09 +01:00
Michael Niedermayer caedd51e56 mxfdec: fix potential integer overflow in mxf_compute_sample_count()
Fixes CID743442
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-17 02:20:50 +01:00
Matthieu Bouron 83cab07a4c mxfdec: set audio packets pts
Also fix playback of ntsc files.

Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-16 14:12:37 +01:00
Janne Grunau c84cce5a99 mxfdec: fix typo in mxf_read_seek()
Check the number of index tables before using byte offset based seeking
instead of the index_tables pointer.

Found by Måns Rullgård <mans@mansr.com>.
2012-11-15 17:37:09 +01:00
Michael Niedermayer d7da4d47a6 mxfdec: avoid double free and leaks.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-11 02:20:04 +01:00
Tomas Härdin 84e7d368d6 mxfdec: Fix inferred misuses of enums
This fixes CID 700457, 700458 and 703705.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-01 16:21:12 +01:00
Tomas Härdin fbb39f44f1 mxfdec: Fix potential leak in mxf_read_local_tags()
This fixes CID 733800.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-24 17:45:49 +02:00
Tomas Härdin 1d22d269f5 mxfdec: Fix a potential DoS vector in mxf_read_pixel_layout()
There's a a potential DoS problem in this function. Say an MXF file is
created with a PixelLayout with a long run of non-zeroes. Such a file could be
sent quickly (packed) over the net and would unpack quite fast. mxfdec would
then read it byte-by-byte, which would take considerable time.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-24 17:44:35 +02:00
Tomas Härdin 187630b244 mxfdec: Fix CID 732262
Coverity thinks ofs can end up 15, thus writing past the end of layout[]. This
is incorrect since it's always incremented by 2. Checking ofs <= 14 makes
Coverity happy and doesn't hurt.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-24 17:44:35 +02:00
Michael Niedermayer f391e405df Merge commit 'e002e3291e6dc7953f843abf56fc14f08f238b21'
* commit 'e002e3291e6dc7953f843abf56fc14f08f238b21':
  Use the new aes/md5/sha/tree allocation functions
  avutil: Add functions for allocating opaque contexts for algorithms
  svq3: fix pointer type warning
  svq3: replace unsafe pointer casting with intreadwrite macros
  parseutils-test: various cleanups

Conflicts:
	doc/APIchanges
	libavcodec/svq3.c
	libavutil/parseutils.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-12 14:52:34 +02:00
Martin Storsjö e002e3291e Use the new aes/md5/sha/tree allocation functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-11 23:35:28 +03:00
Michael Niedermayer 526cb36e4b Merge commit '4436f25a1682ada3f7226cb6fadf429946933161'
* commit '4436f25a1682ada3f7226cb6fadf429946933161':
  build: remove references to unused EXTRAOBJS variable
  lavfi: convert input/ouput list compound literals to named objects
  fate: add h263 obmc vsynth tests
  avconv: remove bogus warning when using avconv -h without parameter
  averror: explicitly define AVERROR_* values
  flashsv: propagate inflateReset() errors
  indeo4/5: remove constant parameter num_bands from wavelet recomposition
  mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
  Double motion vector range for HPEL interlaced picture in proper place

Conflicts:
	libavcodec/v210dec.h
	libavfilter/af_aformat.c
	libavfilter/af_amix.c
	libavfilter/af_asyncts.c
	libavfilter/af_channelmap.c
	libavfilter/af_join.c
	libavfilter/asrc_anullsrc.c
	libavfilter/buffersrc.c
	libavfilter/f_setpts.c
	libavfilter/f_settb.c
	libavfilter/fifo.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fieldorder.c
	libavfilter/vf_fps.c
	libavfilter/vf_hflip.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_select.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/vsrc_testsrc.c
	libavformat/mxfdec.c
	libavutil/error.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-11 15:46:48 +02:00
Janne Grunau bd141f5ec9 mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
Fixes CID732275.
2012-10-10 21:24:32 +02:00
Michael Niedermayer ac627b3d38 Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb':
  Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat

Conflicts:
	doc/examples/muxing.c
	ffmpeg.h
	ffmpeg_filter.c
	ffmpeg_opt.c
	ffplay.c
	ffprobe.c
	libavcodec/8bps.c
	libavcodec/aasc.c
	libavcodec/aura.c
	libavcodec/avcodec.h
	libavcodec/avs.c
	libavcodec/bfi.c
	libavcodec/bmp.c
	libavcodec/bmpenc.c
	libavcodec/c93.c
	libavcodec/cscd.c
	libavcodec/cyuv.c
	libavcodec/dpx.c
	libavcodec/dpxenc.c
	libavcodec/eatgv.c
	libavcodec/escape124.c
	libavcodec/ffv1.c
	libavcodec/flashsv.c
	libavcodec/fraps.c
	libavcodec/h264.c
	libavcodec/huffyuv.c
	libavcodec/iff.c
	libavcodec/imgconvert.c
	libavcodec/indeo3.c
	libavcodec/kmvc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libx264.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc.c
	libavcodec/motionpixels.c
	libavcodec/mpeg12.c
	libavcodec/mpeg12enc.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pamenc.c
	libavcodec/pcxenc.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/pnm.c
	libavcodec/pnmdec.c
	libavcodec/pnmenc.c
	libavcodec/ptx.c
	libavcodec/qdrw.c
	libavcodec/qpeg.c
	libavcodec/qtrleenc.c
	libavcodec/raw.c
	libavcodec/rawdec.c
	libavcodec/rl2.c
	libavcodec/sgidec.c
	libavcodec/sgienc.c
	libavcodec/snowdec.c
	libavcodec/snowenc.c
	libavcodec/sunrast.c
	libavcodec/targa.c
	libavcodec/targaenc.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/tmv.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/vb.c
	libavcodec/vp3.c
	libavcodec/wnv1.c
	libavcodec/xl.c
	libavcodec/xwddec.c
	libavcodec/xwdenc.c
	libavcodec/yop.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/drawutils.c
	libavfilter/formats.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_format.c
	libavfilter/vf_hflip.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/movenc.c
	libavformat/mxf.h
	libavformat/utils.c
	libavformat/yuv4mpeg.c
	libavutil/imgutils.c
	libavutil/pixdesc.c
	libswscale/input.c
	libswscale/output.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	libswscale/x86/swscale_template.c
	libswscale/x86/yuv2rgb.c
	libswscale/x86/yuv2rgb_template.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:06:57 +02:00
Anton Khirnov 716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Marton Balint 13f0cd681e mxfdec: allow container_ul to override codec_ul if codec is A-law
Fixes some DNXHD files generated by AVID TM, where codec UL was set to A-law
meanwhile the real audio codec was PCM S16. According to SMPTE RP 224, A-law is
the default value for sound essence parameters therefore we should handle it
specially.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-27 21:28:35 +02:00
Michael Niedermayer db0087dc1d mxfdec: fix index_tables check in mxf_read_seek()
Approved-by: Tjoppen
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 12:54:00 +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 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
Marton Balint 3be02afb56 mxfdec: fix off by one error in d10 aes3 decoding
Without this fix the last sample was missing from the packet.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-27 13:36:43 +02:00