mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-28 07:29:14 +00:00
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>
This commit is contained in:
commit
b5a69e79c5
15 changed files with 83 additions and 63 deletions
|
@ -420,7 +420,6 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
|
|||
|
||||
dst->has_b_frames = src->has_b_frames;
|
||||
dst->idct_algo = src->idct_algo;
|
||||
dst->slice_count = src->slice_count;
|
||||
|
||||
dst->bits_per_coded_sample = src->bits_per_coded_sample;
|
||||
dst->sample_aspect_ratio = src->sample_aspect_ratio;
|
||||
|
@ -455,8 +454,9 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
|
|||
*
|
||||
* @param dst The destination context.
|
||||
* @param src The source context.
|
||||
* @return 0 on success, negative error code on failure
|
||||
*/
|
||||
static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
|
||||
static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
|
||||
{
|
||||
#define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);
|
||||
dst->flags = src->flags;
|
||||
|
@ -478,6 +478,22 @@ static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
|
|||
dst->frame_number = src->frame_number;
|
||||
dst->reordered_opaque = src->reordered_opaque;
|
||||
dst->thread_safe_callbacks = src->thread_safe_callbacks;
|
||||
|
||||
if (src->slice_count && src->slice_offset) {
|
||||
if (dst->slice_count < src->slice_count) {
|
||||
int *tmp = av_realloc(dst->slice_offset, src->slice_count *
|
||||
sizeof(*dst->slice_offset));
|
||||
if (!tmp) {
|
||||
av_free(dst->slice_offset);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
dst->slice_offset = tmp;
|
||||
}
|
||||
memcpy(dst->slice_offset, src->slice_offset,
|
||||
src->slice_count * sizeof(*dst->slice_offset));
|
||||
}
|
||||
dst->slice_count = src->slice_count;
|
||||
return 0;
|
||||
#undef copy_fields
|
||||
}
|
||||
|
||||
|
@ -588,7 +604,8 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
|
|||
*/
|
||||
|
||||
p = &fctx->threads[fctx->next_decoding];
|
||||
update_context_from_user(p->avctx, avctx);
|
||||
err = update_context_from_user(p->avctx, avctx);
|
||||
if (err) return err;
|
||||
err = submit_packet(p, avpkt);
|
||||
if (err) return err;
|
||||
|
||||
|
@ -764,6 +781,7 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count)
|
|||
if (i) {
|
||||
av_freep(&p->avctx->priv_data);
|
||||
av_freep(&p->avctx->internal);
|
||||
av_freep(&p->avctx->slice_offset);
|
||||
}
|
||||
|
||||
av_freep(&p->avctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue