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 d1f9563d502037239185c11578cc614bdf0c5870)

Conflicts:
	libavcodec/pthread_frame.c
avformat/oggparsevorbis: dont use invalid granules

Fixes Ticket3437

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12b97dd375736c332989c50ea68af9d834b2621f)
lavfi/af_atempo: clear references before returning error.

Once the frame has been given to ff_filter_frame(), it can
no longer be used, even on error.

Fix trac ticket #3430.
(cherry picked from commit bc6901c94944e4a81be49a6b11183cd0c55d2738)
Merge branch 'ffmpeg_track/release-2.1' into adffmpeg_track/trunk

* ffmpeg_track/release-2.1:
  lavfi/af_atempo: clear references before returning error.
  avformat/oggparsevorbis: dont use invalid granules
  pthread_frame: flush all threads on flush, not just the first one

git-svn-id: http://svn.ad-group.adh/svn/native_client/native/ffmpeg/trunk@9956 4601b0d2-a6ba-4ff0-a3bb-59d57de6f651
avcodec/vorbisdec: use the stored previous window type only when the actual previous is not known

Fixes Ticket3432

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5171ae781a240cac3860c20f9aefc6d1b2c61cac)
avformat/flvdec: discard inconsistent timestamps

Fixes Ticket3425

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dbc3e1109cddd7ab653dce0f7758bad17b94803d)
avidec: calculate missing bitrates from index

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 01000064c9518f76bc97b72e81aa34788d88534f)
avformat/avidec: Check required demuxing buffer sizes in guess_ni_flag()

Fixes Ticket3421

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d75730c58f72918a41bb5abda4b448ecdd4273c)
mvformat/movenc: fix IMX

fixes Ticket3351

Tested-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 72d44f15834af68e2620a7051493359d7ee5b2c3)
Merge branch 'ffmpeg_track/release-2.1' into adffmpeg_track/trunk

* ffmpeg_track/release-2.1:
  mvformat/movenc: fix IMX
  avformat/avidec: Check required demuxing buffer sizes in guess_ni_flag()
  avidec: calculate missing bitrates from index
  avformat/flvdec: discard inconsistent timestamps
  avcodec/vorbisdec: use the stored previous window type only when the actual previous is not known

git-svn-id: http://svn.ad-group.adh/svn/native_client/native/ffmpeg/trunk@9958 4601b0d2-a6ba-4ff0-a3bb-59d57de6f651