1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-07 08:30:10 +02:00
Commit Graph

206 Commits

Author SHA1 Message Date
Michael Niedermayer
3c8085dc42 Merge commit 'e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838'
* commit 'e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838':
  pthread: make ff_thread_release_buffer idempotent.
  mvi: set framerate

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 14:19:56 +01:00
Anton Khirnov
e6b1c3bbe7 pthread: make ff_thread_release_buffer idempotent.
I.e. don't do anything on already released frames.
2013-01-29 07:32:10 +01:00
Michael Niedermayer
a6e4796fbf pthread: Do not use a half updated context as master for deallocation.
Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-13 06:22:04 +01:00
Clément Bœsch
98dc25672f lavc/pthread: do not re-define _GNU_SOURCE if already defined.
This fixes the following warning with GCC:
    libavcodec/pthread.c:35:0: warning: _GNU_SOURCE redefined [enabled by default]
    <command-line>::0: note: this is the location of the previous definition

The reason of the presence of this flag is:
    % pkg-config --cflags sdl
    -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL
2012-12-24 00:54:06 +01:00
Michael Niedermayer
874c5b02c4 Merge commit '594d4d5df3c70404168701dd5c90b7e6e5587793'
* commit '594d4d5df3c70404168701dd5c90b7e6e5587793':
  lavc: add a wrapper for AVCodecContext.get_buffer().

Conflicts:
	libavcodec/4xm.c
	libavcodec/8svx.c
	libavcodec/bmv.c
	libavcodec/cljr.c
	libavcodec/cscd.c
	libavcodec/dnxhddec.c
	libavcodec/dpcm.c
	libavcodec/dpx.c
	libavcodec/eacmv.c
	libavcodec/eamad.c
	libavcodec/frwu.c
	libavcodec/g723_1.c
	libavcodec/gifdec.c
	libavcodec/idcinvideo.c
	libavcodec/iff.c
	libavcodec/indeo3.c
	libavcodec/internal.h
	libavcodec/interplayvideo.c
	libavcodec/kmvc.c
	libavcodec/mpc7.c
	libavcodec/mpegaudiodec.c
	libavcodec/pcx.c
	libavcodec/pngdec.c
	libavcodec/pnmdec.c
	libavcodec/rl2.c
	libavcodec/snow.c
	libavcodec/targa.c
	libavcodec/tscc.c
	libavcodec/txd.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/vb.c
	libavcodec/vmdav.c
	libavcodec/vp56.c
	libavcodec/vqavideo.c
	libavcodec/wavpack.c
	libavcodec/wnv1.c
	libavcodec/xl.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-05 15:18:12 +01:00
Anton Khirnov
594d4d5df3 lavc: add a wrapper for AVCodecContext.get_buffer().
It will be useful in the upcoming transition to refcounted AVFrames.
2012-12-04 21:41:59 +01:00
Michael Niedermayer
ebf4750200 pthreads: increase MAX_BUFFERS due to 24c043c98e
This might fix a hypothetical memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-19 17:32:13 +01:00
Michael Niedermayer
abcaacf1ac Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pthread: make sure AVFrame.extended_data is set properly.
  libfdk-aac: reindent after last commit
  libfdk-aac: Limit to supported sample rates.
  cbrt_tablegen: Include libm.h
  oggparsetheora: make it more robust
  ogg: prevent NULL pointer deference in theora gptopts

Conflicts:
	libavformat/oggparsetheora.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-25 16:11:34 +02:00
Anton Khirnov
7a1a9dd56c pthread: make sure AVFrame.extended_data is set properly.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-25 12:03:23 +02:00
Ben Jackson
e3329474a3 pthread: Avoid crashes/odd behavior caused by spurious wakeups
pthread_wait_cond can wake up for no reason (Wikipedia: Spurious_wakeup).
The FF_THREAD_SLICE thread mechanism could spontaneously execute jobs or
allow the caller of avctx->execute to return before all jobs were complete.
This adds tests to both cases to ensure the wakeup is real.

Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-14 06:36:55 +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
Mans Rullgard
11434c9b13 pthread: add const to AVCodec pointers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-18 14:20:57 +01:00
Michael Niedermayer
c581cb4e4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
	configure
	doc/APIchanges
	doc/examples/decoding_encoding.c
	libavcodec/Makefile
	libavcodec/assdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/avpacket.c
	libavcodec/dv_profile.c
	libavcodec/dwt.c
	libavcodec/libtheoraenc.c
	libavcodec/rawdec.c
	libavcodec/rv40dsp.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/v210dec.h
	libavcodec/vc1dsp.c
	libavcodec/x86/Makefile
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/buffer.c
	libavfilter/formats.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_select.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/version.h
	libavutil/audioconvert.c
	libavutil/error.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 16:20:30 +02:00
Martin Storsjö
1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03: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
Michael Niedermayer
7c71f8e0ec pthread: mark lockless thread synchronization variables as volatile
No speed difference was meassureable

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-22 02:07:02 +02:00
Clément Bœsch
55ed91c856 threads: fix a potential race spotted by helgrind. 2012-07-19 19:08:36 +02:00
Michael Niedermayer
0c851e4642 threads: make get_logical_cpus() available outside pthread.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-23 01:38:47 +02:00
Michael Niedermayer
15f8941108 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Avoid C99 variable declarations within for statements.
  rtmp: Read and handle incoming packets while writing data
  doc: document THREAD_TYPE fate variable
  rtpdec: Don't require frames to start with a Mode A packet
  avconv: don't try to free threads that were not initialized.

Conflicts:
	doc/fate.texi
	ffplay.c
	libavdevice/dv1394.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-15 00:14:21 +02:00
Diego Biurrun
d246c18ea6 Avoid C99 variable declarations within for statements.
We generally do not declare variables within for statements and
there are compilers that choke on such constructs.
2012-06-14 23:36:04 +02:00
Michael Niedermayer
653d117c29 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libschroedinger: Switch to function names more in line with Libav style.
  Move code shared between libdirac and libschroedinger to libschroedinger.
  lavfi: uninline avfilter_copy_buffer_ref_props().
  lavf: add missing '*' in a doxy.
  h264: Remove a commented-out function pointer typedef.
  txd: Remove write-only variable in txd_decode_frame().
  mmvideo.c: Remove unused variable in mm_decode_pal().
  build: cosmetics: Add missing end-of-line backslashes to item lists.
  build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line.
  libschroedinger: Move a function to avoid a forward declaration.
  pthread: warn on high thread counts
  vf_yadif: fix missing error handling for avfilter_poll_frame()
  avprobe: allow showing only one container/stream property.
  lavfi: support audio in avfilter_copy_frame_props().
  lavfi: avfilter_merge_formats: handle case where inputs are same
  lavc: add sample rate and channel layout to AVFrame.
  zerocodec: check if the previous frame is missing
  doc: clarify check for NULL pointer style

Conflicts:
	doc/APIchanges
	doc/developer.texi
	ffprobe.c
	libavcodec/Makefile
	libavcodec/avcodec.h
	libavcodec/libdirac_libschro.c
	libavcodec/libdirac_libschro.h
	libavcodec/mmvideo.c
	libavcodec/txd.c
	libavcodec/version.h
	libavcodec/zerocodec.c
	libavfilter/Makefile
	libavfilter/avfilter.c
	libavfilter/version.h
	libavformat/Makefile
	libavutil/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-07 22:51:34 +02:00
Sean McGovern
b68c4ac293 pthread: warn on high thread counts
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-05-07 10:35:01 +02:00
Michael Niedermayer
c047afb80c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avcodec: remove AVCodecContext.dsp_mask
  avconv: fix a segfault when default encoder for a format doesn't exist.
  utvideo: general cosmetics
  aac: Handle HE-AACv2 when sniffing a channel order.
  movenc: Support high sample rates in isomedia formats by setting the sample rate field in stsd to 0.
  xxan: Remove write-only variable in xan_decode_frame_type0().
  ivi_common: Initialize a variable at declaration in ff_ivi_decode_blocks().

Conflicts:
	ffmpeg.c
	libavcodec/utvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-21 22:56:07 +02:00
Mans Rullgard
95510be8c3 avcodec: remove AVCodecContext.dsp_mask
This removes all references to AVCodecContext.dsp_mask and marks
it for eviction at the next version bump.  It has been superseded
by av_set_cpu_flag_mask() which, unlike this field, works everywhere.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-21 18:30:01 +01:00
Dale Curtis
a9d114dc8a pthread: Fix crash due to fctx->delaying not being cleared.
corrects invalid return when avpkt->size == 0.

Reproducible with test case and ffplay -threads 2. Stack trace:
http://pastebin.com/PexZ4Uc0

Test case:
http://commondatastorage.googleapis.com/dalecurtis-shared/crash.ogm

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-13 11:10:38 +02:00
Dale Curtis
97ae370078 pthread: Fix crash due to fctx->delaying not being cleared.
Reproducible with test case and ffplay -threads 2. Stack trace:
http://pastebin.com/PexZ4Uc0

Test case:
http://commondatastorage.googleapis.com/dalecurtis-shared/crash.ogm

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-04-12 21:32:01 -07:00
Aaron Colwell
aa9c2e41b6 pthread : Remove lock/unlock pairs in worker loop to avoid unexpected state changes.
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-26 00:09:50 +02:00
Michael Niedermayer
9621646eb3 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: dsputil: prettyprint gcc inline asm
  x86: K&R prettyprinting cosmetics for dsputil_mmx.c
  x86: conditionally compile H.264 QPEL optimizations
  dsputil_mmx: Surround QPEL macros by "do { } while (0);" blocks.
  Ignore generated files below doc/.
  dpcm: convert to bytestream2.
  interplayvideo: convert to bytestream2.
  movenc: Merge if statements
  h264: fix memleak in error path.
  pthread: Immediately release all frames in ff_thread_flush()
  h264: Add check for invalid chroma_format_idc
  utvideo: port header reading to bytestream2.

Conflicts:
	.gitignore
	configure
	libavcodec/h264_ps.c
	libavcodec/interplayvideo.c
	libavcodec/pthread.c
	libavcodec/x86/dsputil_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-25 23:10:30 +02:00
Marton Balint
5420523ae3 pthread: return proper error code on pthread_create failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-25 12:22:06 +02:00
Michael Niedermayer
8bf95e8bd5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avc: Add a function for converting mp4 style extradata to annex b
  pthread: free progress if buffer allocation failed.
  lavc/avconv: support changing frame sizes in codecs with frame mt.
  libavformat: Document who sets the AVStream.id field
  utvideo: mark output picture as keyframe.
  sunrast: Add support for negative linesize.
  vp8: fix update_lf_deltas in libavcodec/vp8.c
  ralf: read Huffman code lengths without GetBitContext

Conflicts:
	ffmpeg.c
	libavcodec/sunrastenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-25 01:56:53 +01:00
Alexander Strange
147ee4cf06 pthread: Immediately release all frames in ff_thread_flush()
Before this, they were only added to the delayed release queue and not
freed until later. This could lead to unnecessary memory use or buffer
exhaustion.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-24 15:29:51 -07:00
Ronald S. Bultje
2ee01fbded pthread: free progress if buffer allocation failed.
Else we run out of progress variables after a few failed buffer
allocations.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-24 21:29:35 +01:00
Ronald S. Bultje
bc1ef85520 lavc/avconv: support changing frame sizes in codecs with frame mt.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-24 21:29:16 +01:00
Michael Niedermayer
59a4b73531 pthread/mpegvideo: detect and block attempts to init frames after setup.
This fixes race conditions that ultimately lead to memory corruption.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-24 00:32:18 +01:00
Michael Niedermayer
79a19f6e58 pthread: Fix mixing of declarations and statements.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-17 23:49:56 +01:00
Michael Niedermayer
967bdb8572 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  resample: allocate a large enough output buffer
  fate: fix enc_dec_pcm tests with remote target
  wmaenc: remove bit-exact hack
  FATE: remove WMA acodec tests
  FATE: add WMAv1 and WMAv2 encode/decode tests with fuzzy comparison
  FATE: add AC-3 and E-AC-3 encode/decode tests with fuzzy comparison
  qtrle: Use bytestream2 functions to prevent buffer overreads.
  vqavideo: check malloc return values
  x11grab: fix a memory leak exposed by valgrind
  threads: fix old frames returned after avcodec_flush_buffers()
  MPV: always mark dummy frames as reference
  h264: fix deadlocks on incomplete reference frame decoding.
  mpeg4: report frame decoding completion at ff_MPV_frame_end().
  mimic: don't use self as reference, and report completion at end of decode().

Conflicts:
	libavcodec/h264.c
	libavcodec/qtrle.c
	libavcodec/resample.c
	libavcodec/vqavideo.c
	libavdevice/x11grab.c
	tests/ref/seek/wmav1_asf
	tests/ref/seek/wmav2_asf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-17 23:16:05 +01:00
Uoti Urpala
05b9a89ed7 threads: fix old frames returned after avcodec_flush_buffers()
Calling avcodec_flush_buffers() and then avcodec_decode_video2() with
a 0-sized packet (to get remaining buffered frames) could incorrectly
return an old frame from before the avcodec_flush_buffers() call. Add
a loop in ff_thread_flush() to zero the got_frame field of each thread
to ensure the old frames will not be returned.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-16 15:38:18 -07:00
Michael Niedermayer
2af8f2cea6 Merge remote-tracking branch 'qatar/master'
* qatar/master: (27 commits)
  cmdutils: use new avcodec_is_decoder/encoder() functions.
  lavc: make codec_is_decoder/encoder() public.
  lavc: deprecate AVCodecContext.sub_id.
  libcdio: add a forgotten AVClass to the private context.
  swscale: remove "cpu flags" from -sws_flags description.
  proresenc: give user a possibility to alter some encoding parameters
  vorbisenc: add output buffer overwrite protection
  libopencore-amrnbenc: fix end-of-stream handling
  ra144enc: fix end-of-stream handling
  nellymoserenc: zero any leftover packet bytes
  nellymoserenc: use proper MDCT overlap delay
  qpeg: Use bytestream2 functions to prevent buffer overreads.
  swscale: make %rep unconditional.
  vp8: convert simple loopfilter x86 assembly to use named arguments.
  vp8: convert idct x86 assembly to use named arguments.
  vp8: convert mc x86 assembly to use named arguments.
  vp8: convert loopfilter x86 assembly to use cpuflags().
  vp8: convert idct/mc x86 assembly to use cpuflags().
  swscale: remove now unnecessary hack.
  x86inc: don't "bake" stack_offset in named arguments.
  ...

Conflicts:
	cmdutils.c
	doc/APIchanges
	libavcodec/mpeg12.c
	libavcodec/options.c
	libavcodec/qpeg.c
	libavcodec/utils.c
	libavcodec/version.h
	libavdevice/libcdio.c
	tests/lavf-regression.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-05 00:15:55 +01:00
Anton Khirnov
02beb9826b lavc: deprecate AVCodecContext.sub_id.
In most places where it's used, it's as a pointless write-only field.

Only rv10 decoder actually reads from it, but it stores some internal
version info in it. There is no reason for it to be in a public field.
2012-03-04 21:02:45 +01:00
Michael Niedermayer
e3822886eb Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avcodec_default_reget_buffer(): fix compilation in DEBUG mode
  fate: Overhaul WavPack coverage
  h264: fix mmxext chroma deblock to use correct TC values.
  flvdec: Remove the now redundant check for known broken metadata creator
  flvdec: Validate index entries added from metadata while reading
  rtsp: Handle requests from server to client
  movenc: use timestamps instead of frame_size for samples-per-packet
  movenc: use the first cluster duration as the tfhd default duration
  movenc: factorize calculation of cluster duration into a separate function
  doc/APIchanges: fill in missing dates and hashes.
  lavc: reorder AVCodecContext fields.
  lavc: reorder AVFrame fields.

Conflicts:
	doc/APIchanges
	libavcodec/avcodec.h
	libavformat/flvdec.c
	libavformat/movenc.c
	tests/fate/lossless-audio.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-28 03:38:58 +01:00
Anton Khirnov
b1edfce08a lavc: reorder AVCodecContext fields.
Put related fields together, move the important ones closer to the
beginning, try to eliminate holes.
2012-02-27 07:09:43 +01:00
Michael Niedermayer
18a7f7465e threads: Perform the generic progress cleanup more carefully.
The cleanup is only done now when
a picture is returned (assuming that it has to be done when its returned)
a error is returned (assuming that there will be no further progress on the frame)
the codec is not h264 (this is still needed due to some deadlocks in realvideo)

This fixes a decoding regression with 00017.MTS

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-12 20:24:29 +01:00
Michael Niedermayer
6be0960851 threads: move state update after progress cleanup.
This order is more logic and might prevent a race.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-12 20:24:29 +01:00
Michael Niedermayer
cf7c7f13cd pthreads: Generic progress lubrication support.
Fixes bug118, bug120 and bug125 at least

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 19:47:49 +01:00
Michael Niedermayer
575d494de5 pthreads: reset got_frames on flush.
This fixes memory corruption when seeking in broken streams.
a random mpeg4 in nut file was used to debug.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 19:47:49 +01:00
Michael Niedermayer
199d4478de pthread: Change a signal to a broadcast as multiple threads
have been seen waiting and deadlocking on it in bug125.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-22 23:07:09 +01:00
Michael Niedermayer
b5a69e79c5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Use our own SSRC in the SDES field when sending RRs
  Finalize changelog for 0.8 Release
  Prepare for 0.8 Release
  threads: change the default for threads back to 1
  threads: update slice_count and slice_offset from user context
  aviocat: Remove useless includes
  doc/APIChanges: fill in missing dates and hashes
  Revert "avserver: fix build after the next bump."
  mpegaudiodec: switch error detection check to AV_EF_BUFFER
  lavf: rename fer option and document resulting (f_)err_detect options
  lavc: rename err_filter option to err_detect and document it
  mpegvideo: fix invalid memory access for small video dimensions
  movenc: Reorder entries in the MOVIentry struct, for tigheter packing
  rtsp: Remove extern declarations for variables that don't exist
  aviocat: Flush the output before closing

Conflicts:
	Changelog
	RELEASE
	libavcodec/mpegaudiodec.c
	libavcodec/pthread.c
	libavformat/options.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 23:11:27 +01:00
Janne Grunau
afb8b207d6 threads: update slice_count and slice_offset from user context
They are used to signal the number of slices and offsets of each slice
out of band to the decoder.
2012-01-21 13:26:44 +01:00
Michael Niedermayer
757473831c Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits)
  cabac: Move code only used within the CABAC test program into the test program.
  vp56: Drop unnecessary cabac.h #include.
  h264-test: Initialize AVCodecContext.av_class.
  build: Skip compiling network.h and rtsp.h if networking is not enabled.
  cosmetics: drop some pointless parentheses
  Disable annoying warning without changing behavior
  faq: Solutions for common problems with sample paths when running FATE.
  avcodec: attempt to clarify the CODEC_CAP_DELAY documentation
  avcodec: fix avcodec_encode_audio() documentation.
  FATE: xmv-demux test; exercise the XMV demuxer without decoding the perceptual codecs inside.
  vqf: recognize more metadata chunks
  FATE test: BMV demuxer and associated video and audio decoders.
  FATE: indeo4 video decoder test.
  FATE: update xxan-wc4 test to a sample with more code coverage.
  Change the recent h264_mp4toannexb bitstream filter test to output to an elementary stream rather than a program stream.
  g722enc: validate AVCodecContext.trellis
  g722enc: set frame_size, and also handle an odd number of input samples
  g722enc: split encoding into separate functions for trellis vs. no trellis
  mpegaudiodec: Use clearer pointer math
  tta: Fix returned error code at EOF
  ...

Conflicts:
	libavcodec/h264.c
	libavcodec/indeo3.c
	libavcodec/interplayvideo.c
	libavcodec/ivi_common.c
	libavcodec/libxvidff.c
	libavcodec/mpegvideo.c
	libavcodec/ppc/mpegvideo_altivec.c
	libavcodec/tta.c
	libavcodec/utils.c
	libavfilter/vsrc_buffer.c
	libavformat/Makefile
	tests/fate/indeo.mak
	tests/ref/acodec/g722

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-08 03:34:22 +01:00
Diego Biurrun
3dc99a18d4 cosmetics: drop some pointless parentheses 2012-01-07 22:13:07 +01:00
Michael Niedermayer
ad1c8dd673 Merge remote-tracking branch 'qatar/master'
* 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>
2012-01-04 01:12:34 +01:00
Daniel Verkamp
02e8f4272c win32: detect number of CPUs using affinity
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-03 14:25:57 +01:00
Michael Niedermayer
4121148388 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avconv: make -frames work for all types of streams, not just video.
  bfi: K&R cosmetics
  bgmc: K&R cleanup
  rawdec: Set start_time to 0 for raw audio files.
  Detect 'yuv2' as rawvideo also in avi.
  rawdec: propagate pict_type information to the output frame
  rawdec: Support more QT 1bpp rawvideo files.
  avconv: free bitstream filters
  threads: limit the number of automatic threads to MAX_AUTO_THREADS
  avplay: K&R cleanup
  fate: use rgb24 as output format for dfa tests
  threads: set thread_count to 1 when thread support is disabled
  threads: introduce CODEC_CAP_AUTO_THREADS and add it to libx264

Conflicts:
	ffplay.c
	libavcodec/avcodec.h
	libavcodec/pthread.c
	libavcodec/version.h
	tests/ref/fate/dfa1
	tests/ref/fate/dfa10
	tests/ref/fate/dfa11
	tests/ref/fate/dfa2
	tests/ref/fate/dfa3
	tests/ref/fate/dfa4
	tests/ref/fate/dfa5
	tests/ref/fate/dfa6
	tests/ref/fate/dfa7
	tests/ref/fate/dfa8
	tests/ref/fate/dfa9

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-02 03:10:30 +01:00
Janne Grunau
b12d217339 threads: limit the number of automatic threads to MAX_AUTO_THREADS
The extra thread added in {frame_}*thread_init was not taken into
account. Explicitly sets thread_count to 1 if only one CPU core was
detected. Also fixes two typos in comments.
2012-01-01 21:11:43 +01:00
Janne Grunau
b4d44a45f9 threads: introduce CODEC_CAP_AUTO_THREADS and add it to libx264
Some external codecs have their own code to determine the best number
of threads. This number is not necessary the number of cpu cores.
Thread_count will be only 0 if the codec has CODEC_CAP_AUTO_THREADS.
2012-01-01 14:37:37 +01:00
Michael Niedermayer
57581e4110 pthread: dont autoenable frame threads with visualization
This combination doesnt work

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-01 02:54:31 +01:00
Michael Niedermayer
e404eee1e1 pthread: Limit automatic threads to mb_height.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-01 02:39:06 +01:00
Michael Niedermayer
4478e9d8db Merge remote-tracking branch 'qatar/master'
* 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>
2012-01-01 00:07:31 +01:00
Janne Grunau
bcc7396065 threads: add sysconf based number of CPUs detection
Can act as fallback and should work on a couple of Unix systems.
2011-12-31 17:40:12 +01:00
Janne Grunau
937ff3a18a threads: always include necessary headers for number of CPUs detection
Since the conditions for the actual usage are more specific a less
preferred method can be used. This would cause compilation errors
because necessary headers are not included.
2011-12-31 17:40:12 +01:00
Michael Niedermayer
0e5fbbd776 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo_enc: K&R cosmetics
  doxygen: remove unreplaced variables from custom header and footer
  threads: test for sys/param.h and include it for sysctl on OpenBSD
  v4l2: remove unneded linux specific asm/types.h include
  x86: Fix constraints for decode_significance*_x86

Conflicts:
	libavcodec/mpegvideo_enc.c
	libavdevice/v4l2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-28 02:38:33 +01:00
Janne Grunau
06bb590558 threads: test for sys/param.h and include it for sysctl on OpenBSD 2011-12-27 16:09:41 +01:00
Michael Niedermayer
484e59a0a0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avs: call release_buffer() at the end.
  Add minor bumps and APIchanges entries for lavc/lavfi changes.
  mpegvideo.c: K&R formatting and cosmetics.
  avconv: avoid memcpy in vsrc_buffer when possible.
  avconv: implement get_buffer()/release_buffer().
  lavfi: add a new function av_buffersrc_buffer().
  lavfi: add avfilter_copy_frame_props()
  lavc: add format field to AVFrame
  lavc: add width and height fields to AVFrame
  lavc: add a sample_aspect_ratio field to AVFrame
  doxy: add website-alike style to the html output
  FAQ: add an entry for common error when using -profile

Conflicts:
	avconv.c
	cmdutils.c
	doc/APIchanges
	libavcodec/avcodec.h
	libavcodec/mpegvideo.c
	libavcodec/utils.c
	libavcodec/version.h
	libavfilter/Makefile
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/src_movie.c
	libavfilter/vsrc_buffer.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-26 04:10:47 +01:00
Stefano Sabatini
8a4a5f6ff7 lavc: add format field to AVFrame
The format is a per-frame property, having it in AVFrame simplify the
operation of extraction of that information, since avoids the need to
access the codec/stream context.
2011-12-25 16:18:57 +01:00
Stefano Sabatini
3a2ddf7c2c lavc: add width and height fields to AVFrame
width and height are per-frame properties, setting these values in
AVFrame simplify the operation of extraction of that information,
since avoids the need to check the codec/stream context.
2011-12-25 16:18:57 +01:00
Stefano Sabatini
b58dbb5b03 lavc: add a sample_aspect_ratio field to AVFrame
The sample aspect ratio is a per-frame property, so it makes sense to
define it in AVFrame rather than in the codec/stream context.
Simplify application-level sample aspect ratio information extraction,
and allow further simplifications.
2011-12-25 16:18:57 +01:00
Michael Niedermayer
7de733b752 pthread: sysctl.h needs param.h on openbsd
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-23 16:34:46 +01:00
Janne Grunau
5c33a9a5c1 threads: check defines before using them in automatic thread detection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-23 16:08:39 +01:00
Janne Grunau
8d4668cc5f pthread: include sys/types.h before sys/sysctl.h
Fixes compilation on FreeBSD with clang 3.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-23 16:08:39 +01:00
Janne Grunau
7052618c7e threads: check defines before using them in automatic thread detection 2011-12-23 14:41:03 +01:00
Janne Grunau
846dca1aa3 pthread: include sys/types.h before sys/sysctl.h
Fixes compilation on FreeBSD with clang 3.
2011-12-23 14:40:39 +01:00
Michael Niedermayer
d1c28e3530 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  build: fix standalone compilation of OMA muxer
  build: fix standalone compilation of Microsoft XMV demuxer
  build: fix standalone compilation of Core Audio Format demuxer
  kvmc: fix invalid reads
  4xm: Add a check in decode_i_frame to prevent buffer overreads
  adpcm: fix IMA SMJPEG decoding
  options: set minimum for "threads" to zero
  bsd: use number of logical CPUs as automatic thread count
  windows: use number of CPUs as automatic thread count
  linux: use number of CPUs as automatic thread count
  pthreads: reset active_thread_type when slice thread_init returrns early
  v410dec: include correct headers
  Drop ALT_ prefix from BITSTREAM_READER_LE name.
  lavfi: always build vsrc_buffer.
  ra144enc: zero the reflection coeffs if the filter is unstable
  sws: readd PAL8 to isPacked()
  mov: Don't stick the QuickTime field ordering atom in extradata.
  truespeech: fix invalid reads in truespeech_apply_twopoint_filter()

Conflicts:
	configure
	libavcodec/4xm.c
	libavcodec/avcodec.h
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavformat/Makefile
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-23 03:25:51 +01:00
Janne Grunau
b9e2226972 bsd: use number of logical CPUs as automatic thread count 2011-12-22 21:50:07 +01:00
Janne Grunau
ad29ecbff0 windows: use number of CPUs as automatic thread count 2011-12-22 21:50:07 +01:00
Janne Grunau
ea4d5f4837 linux: use number of CPUs as automatic thread count
Use sched_getaffinity to determine the number of logical CPUs.
Limits the number of threads to 16 since slice threading of H.264
seems to be buggy with more than 16 threads.
2011-12-22 21:50:07 +01:00
Janne Grunau
f77f640b30 pthreads: reset active_thread_type when slice thread_init returrns early 2011-12-22 21:50:07 +01:00
Michael Niedermayer
7c29313b38 Merge remote-tracking branch 'qatar/master'
* 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>
2011-12-19 02:34:18 +01:00
Mans Rullgard
8400b126ac avcodec: deprecate AVFrame.age
This was intended as an optimisation for skipped blocks in MPEG2
P-frames and never used elsewhere.  Removing this "optimisation"
speeds up MPEG2 decoding by 1-2% (ARM Cortex-A9).

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-18 22:14:33 +00:00
Michael Niedermayer
8bc7fe4daf Merge remote-tracking branch 'qatar/master'
* 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>
2011-12-13 00:39:48 +01:00
Diego Biurrun
58c42af722 doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
Anatoliy Wasserman
6778f9d9f2 pthread: fixed thread initialization issues related to thread-safe buffer allocator
Signed-off-by: Anatoliy Wasserman <anatoliy.wasserman@yandex.ru>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-08 02:01:21 +01:00
Michael Niedermayer
c40a35f8a7 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  indeo3: check per-plane data buffer against input buffer bounds.
  avconv: Handle audio sync for non-S16 sample formats.
  pthread: don't increment index on zero-sized packets.

Conflicts:
	libavcodec/indeo3.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-30 02:34:35 +01:00
Aaron Colwell
39a7a5b8ab pthread: don't increment index on zero-sized packets.
The next call to decode() will update from an invalid index, which will
either lead to a memcpy() where dest==src (2 threads), or lead to a
crash (>2 threads).

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-28 20:30:30 -08:00
Michael Niedermayer
1e19927f12 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  vc1: use an enum for Frame Coding Mode
  doc: cleanup filter section
  indeo3: error out if no motion vector is set.
  x86inc: Flag shufps as an floating-point instruction for the AVX emulation code.
  mpegaudio: do not use init_static_data() for initializing tables.
  musepack: fix signed shift overflow in mpc_read_packet()
  mov: Make format string match variable type.
  wmavoice: Make format string match variable type.
  vc1: select interlaced scan table by FCM element
  Generalize RIFF INFO tag support; support reading INFO tag in wav
  pthread: track thread existence in a separate variable.

Conflicts:
	doc/filters.texi
	libavcodec/pthread.c
	libavformat/avi.c
	libavformat/riff.c
	libavformat/riff.h
	libavformat/wav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-28 01:07:11 +01:00
Michael Niedermayer
47044625ba pthread: check pthread_create() return value.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-27 06:17:03 +01:00
Michael Niedermayer
2bb79b23fe pthread: next try on freeing threads without crashing.
This should fix mingw

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-27 05:55:20 +01:00
Cheng Sun
3f5aa7dfa6 pthread: track thread existence in a separate variable.
This fixes a compile error on mingw32 when using p->thread
directly (as if it were a pointer) to track thread existence,
because the type is opaque and may be a non-pointer.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-26 17:14:13 -08:00
Michael Niedermayer
5c15b78e4a Merge remote-tracking branch 'qatar/master'
* qatar/master: (42 commits)
  swscale: fix signed overflow in yuv2mono_X_c_template
  snow: fix integer overflows
  svq1enc: remove stale altivec-related hack
  snow: fix signed overflow in byte to 32-bit replication
  adx: rename ff_adx_decode_header() to avpriv_adx_decode_header()
  avformat: add CRI ADX format demuxer
  adx: add an ADX parser.
  adx: move header decoding to ADX common code
  adx: calculate the number of blocks in a packet
  adx: define and use 2 new macro constants BLOCK_SIZE and BLOCK_SAMPLES
  adx: check for unsupported ADX formats
  adx: simplify encoding by using put_sbits()
  adx: calculate correct LPC coeffs
  adx: use 12-bit coefficients instead of 14-bit to avoid integer overflow
  adx: simplify adx_decode() by using get_sbits() to read residual samples
  adx: fix the data offset parsing in adx_decode_header()
  adx: remove unneeded post-decode channel interleaving
  adx: validate header values
  adx: cosmetics: general pretty-printing and comment clean-up
  adx: remove useless comments
  ...

Conflicts:
	Changelog
	libavcodec/cook.c
	libavcodec/fraps.c
	libavcodec/nuv.c
	libavcodec/pthread.c
	libavcodec/version.h
	libavformat/Makefile
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-27 00:30:13 +01:00
Cheng Sun
e524eadbf8 [PATCH] Fix crash when initializing multi-threaded decoding for corrupted file.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-26 10:46:08 -08:00
Michael Niedermayer
61c2cec957 pthreads: fix segfault due to the thread beimg killed before it has been allocated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-26 17:55:01 +01:00
Michael Niedermayer
022f8d27dd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: Readd #define _SVID_SOURCE
  Fix av_get_channel_layout_string() for positions >31
  configure: Store vda lib flags in extralibs instead of ldflags
  Make channel layout masks unsigned
  dca: ARMv6 optimised decode_blockcode()
  nullenc: drop AVFMT_RAWPICTURE from the flags
  frame-mt: return consumed packet size in ff_thread_decode_frame
  aacdec: add more fate tests covering SBR and PS
  MK(BE)TAG: avoid undefined shifts

Conflicts:
	configure
	libavcodec/arm/dca.h
	libavcodec/dca.c
	libavcodec/mlp_parser.c
	libavcodec/version.h
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/defaults.c
	libavutil/audioconvert.c
	libavutil/avutil.h
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-26 01:12:08 +01:00
Janne Grunau
117e2a30f2 frame-mt: return consumed packet size in ff_thread_decode_frame
This is required to fulfill avcodec_decode_video2() promise to return
the number of consumed bytes on success.
2011-11-25 08:25:12 +01:00
Michael Niedermayer
0b9a69f244 Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  aacdec: Fix PS in ADTS.
  avconv: Consistently use PIX_FMT_NONE.
  dsputil: use cpuflags in x86 emu_edge_core
  dsputil: use movups instead of movdqu in ff_emu_edge_core_sse()
  wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
  mov: Remove some redundant and obsolete comments.
  Add libavutil/mathematics.h #includes for INFINITY
  doxy: structure libavformat groups
  doxy: introduce an empty structure in libavcodec
  doxy: provide a start page and document libavutil
  doxy: cleanup pixfmt.h
  regtest: split video encode/decode tests into individual targets
  ARM: add explicit .arch and .fpu directives to asm.S
  pthread: do not touch has_b_frames
  avconv: cleanup the transcoding loop in output_packet().
  avconv: split subtitle transcoding out of output_packet().
  avconv: split video transcoding out of output_packet().
  avconv: split audio transcoding out of output_packet().
  avconv: reindent.
  avconv: move streamcopy-only code out of decoding loop.
  ...

Conflicts:
	avconv.c
	libavcodec/aaccoder.c
	libavcodec/pthread.c
	libavcodec/version.h
	libavutil/audioconvert.h
	libavutil/avutil.h
	libavutil/mem.h
	tests/ref/vsynth1/dv
	tests/ref/vsynth1/mpeg2thread
	tests/ref/vsynth2/dv
	tests/ref/vsynth2/mpeg2thread

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-23 04:02:17 +01:00
Janne Grunau
0945eddec0 pthread: do not touch has_b_frames
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>
2011-11-22 09:50:33 +01:00
Michael Niedermayer
7876f14f8b Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pthread: add some malloc failure checks
  avconv: cosmetics, reformat transcode_init()
  avconv: rename 'os' variable to 'oc'
  doc/filters: fix some typos.
  configure: add libpulse to help output

Conflicts:
	avconv.c
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-22 02:54:50 +01:00
Justin Ruggles
a8fe9a7242 pthread: add some malloc failure checks 2011-11-21 10:18:25 -05:00
Michael Niedermayer
dbb38bc389 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: Fix stack alignment for SSE
  avcodec: move some AVCodecContext fields to an internal struct.
  avcodec: use av_opt_set() instead of deprecated av_set_string3()
  avcodec: fix some const warnings
  avcodec: remove pointless AVOption, internal_buffer_count
  imgutils: Fix illegal read.

Conflicts:
	doc/APIchanges
	libavcodec/avcodec.h
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-20 02:46:06 +01:00
Justin Ruggles
f3a29b750a avcodec: move some AVCodecContext fields to an internal struct.
A new field, AVCodecContext.internal is used to hold a new struct
AVCodecInternal, which has private fields that are not codec-specific and are
used by general libavcodec functions.

Moved internal_buffer, internal_buffer_count, and is_copy.
2011-11-19 10:01:05 -05:00
KO Myung-Hun
ad0bdd2fd2 lavc: add supports of OS/2 threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-13 17:33:09 +01:00
Michael Niedermayer
3cc1af9dd9 pthreads: export the delay that was previously exported by mangling has_b_frames through
AVCodecContext.delay which was previously unused for decoders and fits better.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-10 05:19:58 +01:00