Commit Graph

157 Commits

Author SHA1 Message Date
Anton Khirnov 2256b2a3c1 pthread_frame: flush all threads on flush, not just the first one
avcodec_flush_buffers() must release all internally held references
according to its documentation, for which all the threads need to be
flushed.

Bug-Id: vlc/9665
(cherry picked from commit d1f9563d50)

Conflicts:
	libavcodec/pthread_frame.c
2014-03-04 01:39:11 +01:00
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