History

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

Michael Niedermayer committed 14 years ago

Commit b5a69e72 parents 9e53f62 ad7beb215 files · +83 −63Browse files

Unified · Split

15 files
  1. RELEASE +0 −1
  2. avconv.c +4 −0
  3. doc/APIchanges +5 −5
  4. ffplay.c +2 −0
  5. ffserver.c +10 −12
  6. libavcodec/mpegaudiodec.c +2 −2
  7. libavcodec/mpegvideo.c +6 −6
  8. libavcodec/mpegvideo_common.h +14 −14
  9. libavcodec/options.c +6 −6
  10. libavcodec/pthread.c +21 −3
  11. libavformat/movenc.h +2 −2
  12. libavformat/options.c +8 −3
  13. libavformat/rtpdec.c +1 −1
  14. libavformat/rtsp.h +0 −3
  15. tools/aviocat.c +2 −5
RELEASE+0−1
@@ -1,2 +1 @@
11 0.9.1.git
2−
avconv.c+4−0
@@ -2284,6 +2284,8 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb · 2283 unmodified lines
22842284 ist->st->codec->opaque = ist;
22852285 }
22862286
2287+ if (!av_dict_get(ist->opts, "threads", NULL, 0))
2288+ av_dict_set(&ist->opts, "threads", "auto", 0);
22872289 if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) {
22882290 snprintf(error, error_len, "Error while opening decoder for input stream #%d:%d",
22892291 ist->file_index, ist->st->index);
@@ -2574,6 +2576,8 @@ static int transcode_init(OutputFile *output_files, · 284 unmodified lines
25742576 memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
25752577 ost->st->codec->subtitle_header_size = dec->subtitle_header_size;
25762578 }
2579+ if (!av_dict_get(ost->opts, "threads", NULL, 0))
2580+ av_dict_set(&ost->opts, "threads", "auto", 0);
25772581 if (avcodec_open2(ost->st->codec, codec, &ost->opts) < 0) {
25782582 snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",
25792583 ost->file_index, ost->index);
doc/APIchanges+5−5
@@ -13,15 +13,15 @@ libavutil: 2011-04-18 · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16−2012-xx-xx - lavc 53.34.0
16+2012-01-15 - lavc 53.34.0
1717 New audio encoding API:
18− xxxxxxx Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
18+ b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
1919 encoders.
20− xxxxxxx Add avcodec_fill_audio_frame() as a convenience function.
21− xxxxxxx Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
20+ 5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
21+ b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
2222 Add AVCodec.encode2().
2323
24−2012-01-xx - xxxxxxx - lavfi 2.15.0
24+2012-01-12 - 3167dc9 - lavfi 2.15.0
2525 Add a new installed header -- libavfilter/version.h -- with version macros.
2626
2727 2011-12-08 - a502939 - lavfi 2.52.0
ffplay.c+2−0
@@ -2266,6 +2266,8 @@ static int stream_component_open(VideoState *is, int stream_index) · 2265 unmodified lines
22662266 }
22672267 }
22682268
2269+ if (!av_dict_get(opts, "threads", NULL, 0))
2270+ av_dict_set(&opts, "threads", "auto", 0);
22692271 if (!codec ||
22702272 avcodec_open2(avctx, codec, &opts) < 0)
22712273 return -1;
ffserver.c+10−12
@@ -30,16 +30,13 @@ · 29 unmodified lines
3030 #include <string.h>
3131 #include <stdlib.h>
3232 #include "libavformat/avformat.h"
33−// FIXME those are internal headers, avserver _really_ shouldn't use them
3433 #include "libavformat/ffm.h"
3534 #include "libavformat/network.h"
3635 #include "libavformat/os_support.h"
3736 #include "libavformat/rtpdec.h"
3837 #include "libavformat/rtsp.h"
38+// XXX for ffio_open_dyn_packet_buffer, to be removed
3939 #include "libavformat/avio_internal.h"
40−#include "libavformat/internal.h"
41−#include "libavformat/url.h"
42−
4340 #include "libavutil/avstring.h"
4441 #include "libavutil/lfg.h"
4542 #include "libavutil/dict.h"
@@ -877,7 +874,7 @@ static void close_connection(HTTPContext *c) · 831 unmodified lines
877874 }
878875 h = c->rtp_handles[i];
879876 if (h)
880− ffurl_close(h);
877+ url_close(h);
881878 }
882879
883880 ctx = &c->fmt_ctx;
@@ -2258,6 +2255,7 @@ static int http_prepare_data(HTTPContext *c) · 1374 unmodified lines
22582255 * Default value from FFmpeg
22592256 * Try to set it use configuration option
22602257 */
2258+ c->fmt_ctx.preload = (int)(0.5*AV_TIME_BASE);
22612259 c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE);
22622260
22632261 if (avformat_write_header(&c->fmt_ctx, NULL) < 0) {
@@ -2376,7 +2374,7 @@ static int http_prepare_data(HTTPContext *c) · 112 unmodified lines
23762374 if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP)
23772375 max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
23782376 else
2379− max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size;
2377+ max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]);
23802378 ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size);
23812379 } else {
23822380 ret = avio_open_dyn_buf(&ctx->pb);
@@ -2529,8 +2527,8 @@ static int http_send_data(HTTPContext *c) · 146 unmodified lines
25292527 } else {
25302528 /* send RTP packet directly in UDP */
25312529 c->buffer_ptr += 4;
2532− ffurl_write(c->rtp_handles[c->packet_stream_index],
2533− c->buffer_ptr, len);
2530+ url_write(c->rtp_handles[c->packet_stream_index],
2531+ c->buffer_ptr, len);
25342532 c->buffer_ptr += len;
25352533 /* here we continue as we can send several packets per 10 ms slot */
25362534 }
@@ -3413,10 +3411,10 @@ static int rtp_new_av_stream(HTTPContext *c, · 876 unmodified lines
34133411 "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
34143412 }
34153413
3416− if (ffurl_open(&h, ctx->filename, AVIO_FLAG_WRITE, NULL, NULL) < 0)
3414+ if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0)
34173415 goto fail;
34183416 c->rtp_handles[stream_index] = h;
3419− max_packet_size = h->max_packet_size;
3417+ max_packet_size = url_get_max_packet_size(h);
34203418 break;
34213419 case RTSP_LOWER_TRANSPORT_TCP:
34223420 /* RTP/TCP case */
@@ -3439,7 +3437,7 @@ static int rtp_new_av_stream(HTTPContext *c, · 16 unmodified lines
34393437 if (avformat_write_header(ctx, NULL) < 0) {
34403438 fail:
34413439 if (h)
3442− ffurl_close(h);
3440+ url_close(h);
34433441 av_free(ctx);
34443442 return -1;
34453443 }
@@ -3476,7 +3474,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop · 30 unmodified lines
34763474 }
34773475 fst->priv_data = av_mallocz(sizeof(FeedData));
34783476 fst->index = stream->nb_streams;
3479− avpriv_set_pts_info(fst, 33, 1, 90000);
3477+ av_set_pts_info(fst, 33, 1, 90000);
34803478 fst->sample_aspect_ratio = codec->sample_aspect_ratio;
34813479 stream->streams[stream->nb_streams++] = fst;
34823480 return fst;
libavcodec/mpegaudiodec.c+2−2
@@ -987,10 +987,10 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, · 986 unmodified lines
987987 /* skip extension bits */
988988 bits_left = end_pos2 - get_bits_count(&s->gb);
989989 //av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer);
990− if (bits_left < 0 && (s->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT))) {
990+ if (bits_left < 0 && (s->err_recognition & (AV_EF_BUFFER|AV_EF_COMPLIANT))) {
991991 av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
992992 s_index=0;
993− } else if (bits_left > 0 && (s->err_recognition & (AV_EF_BITSTREAM|AV_EF_AGGRESSIVE))) {
993+ } else if (bits_left > 0 && (s->err_recognition & (AV_EF_BUFFER|AV_EF_AGGRESSIVE))) {
994994 av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
995995 s_index = 0;
996996 }
libavcodec/mpegvideo.c+6−6
@@ -1805,8 +1805,8 @@ static inline int hpel_motion_lowres(MpegEncContext *s, · 1804 unmodified lines
18051805
18061806 src += src_y * stride + src_x;
18071807
1808− if ((unsigned)src_x > h_edge_pos - (!!sx) - w ||
1809− (unsigned)src_y > (v_edge_pos >> field_based) - (!!sy) - h) {
1808+ if ((unsigned)src_x > FFMAX( h_edge_pos - (!!sx) - w, 0) ||
1809+ (unsigned)src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
18101810 s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w + 1,
18111811 (h + 1) << field_based, src_x,
18121812 src_y << field_based,
@@ -1907,8 +1907,8 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, · 94 unmodified lines
19071907 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
19081908 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
19091909
1910− if ((unsigned) src_x > h_edge_pos - (!!sx) - 2 * block_s ||
1911− (unsigned) src_y > (v_edge_pos >> field_based) - (!!sy) - h) {
1910+ if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) ||
1911+ (unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
19121912 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
19131913 s->linesize, 17, 17 + field_based,
19141914 src_x, src_y << field_based, h_edge_pos,
@@ -1990,8 +1990,8 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s, · 75 unmodified lines
19901990 offset = src_y * s->uvlinesize + src_x;
19911991 ptr = ref_picture[1] + offset;
19921992 if (s->flags & CODEC_FLAG_EMU_EDGE) {
1993− if ((unsigned) src_x > h_edge_pos - (!!sx) - block_s ||
1994− (unsigned) src_y > v_edge_pos - (!!sy) - block_s) {
1993+ if ((unsigned) src_x > FFMAX(h_edge_pos - (!!sx) - block_s, 0) ||
1994+ (unsigned) src_y > FFMAX(v_edge_pos - (!!sy) - block_s, 0)) {
19951995 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
19961996 9, 9, src_x, src_y, h_edge_pos, v_edge_pos);
19971997 ptr = s->edge_emu_buffer;
libavcodec/mpegvideo_common.h+14−14
@@ -81,8 +81,8 @@ static inline void gmc1_motion(MpegEncContext *s, · 80 unmodified lines
8181 ptr = ref_picture[0] + (src_y * linesize) + src_x;
8282
8383 if(s->flags&CODEC_FLAG_EMU_EDGE){
84− if( (unsigned)src_x >= s->h_edge_pos - 17
85− || (unsigned)src_y >= s->v_edge_pos - 17){
84+ if( (unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0)
85+ || (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)){
8686 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos);
8787 ptr= s->edge_emu_buffer;
8888 }
@@ -120,8 +120,8 @@ static inline void gmc1_motion(MpegEncContext *s, · 31 unmodified lines
120120 offset = (src_y * uvlinesize) + src_x;
121121 ptr = ref_picture[1] + offset;
122122 if(s->flags&CODEC_FLAG_EMU_EDGE){
123− if( (unsigned)src_x >= (s->h_edge_pos>>1) - 9
124− || (unsigned)src_y >= (s->v_edge_pos>>1) - 9){
123+ if( (unsigned)src_x >= FFMAX((s->h_edge_pos>>1) - 9, 0)
124+ || (unsigned)src_y >= FFMAX((s->v_edge_pos>>1) - 9, 0)){
125125 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
126126 ptr= s->edge_emu_buffer;
127127 emu=1;
@@ -221,8 +221,8 @@ static inline int hpel_motion(MpegEncContext *s, · 93 unmodified lines
221221 src += src_y * stride + src_x;
222222
223223 if(s->unrestricted_mv && (s->flags&CODEC_FLAG_EMU_EDGE)){
224− if( (unsigned)src_x > h_edge_pos - (motion_x&1) - w
225− || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
224+ if( (unsigned)src_x > FFMAX(h_edge_pos - (motion_x&1) - w, 0)
225+ || (unsigned)src_y > FFMAX(v_edge_pos - (motion_y&1) - h, 0)){
226226 s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w+1, (h+1)<<field_based,
227227 src_x, src_y<<field_based, h_edge_pos, s->v_edge_pos);
228228 src= s->edge_emu_buffer;
@@ -307,8 +307,8 @@ if(s->quarter_sample) · 78 unmodified lines
307307 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
308308 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
309309
310− if( (unsigned)src_x > s->h_edge_pos - (motion_x&1) - 16
311− || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
310+ if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&1) - 16, 0)
311+ || (unsigned)src_y > FFMAX( v_edge_pos - (motion_y&1) - h , 0)){
312312 if(is_mpeg12 || s->codec_id == CODEC_ID_MPEG2VIDEO ||
313313 s->codec_id == CODEC_ID_MPEG1VIDEO){
314314 av_log(s->avctx,AV_LOG_DEBUG,
@@ -510,8 +510,8 @@ static inline void qpel_motion(MpegEncContext *s, · 195 unmodified lines
510510 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
511511 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
512512
513− if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16
514− || (unsigned)src_y > v_edge_pos - (motion_y&3) - h ){
513+ if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&3) - 16, 0)
514+ || (unsigned)src_y > FFMAX( v_edge_pos - (motion_y&3) - h , 0)){
515515 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
516516 17, 17+field_based, src_x, src_y<<field_based,
517517 s->h_edge_pos, s->v_edge_pos);
@@ -588,8 +588,8 @@ static inline void chroma_4mv_motion(MpegEncContext *s, · 70 unmodified lines
588588 offset = src_y * s->uvlinesize + src_x;
589589 ptr = ref_picture[1] + offset;
590590 if(s->flags&CODEC_FLAG_EMU_EDGE){
591− if( (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8
592− || (unsigned)src_y > (s->v_edge_pos>>1) - (dxy>>1) - 8){
591+ if( (unsigned)src_x > FFMAX((s->h_edge_pos>>1) - (dxy &1) - 8, 0)
592+ || (unsigned)src_y > FFMAX((s->v_edge_pos>>1) - (dxy>>1) - 8, 0)){
593593 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
594594 9, 9, src_x, src_y,
595595 s->h_edge_pos>>1, s->v_edge_pos>>1);
@@ -760,8 +760,8 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s, · 164 unmodified lines
760760
761761 ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
762762 if(s->flags&CODEC_FLAG_EMU_EDGE){
763− if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8
764− || (unsigned)src_y > s->v_edge_pos - (motion_y&3) - 8 ){
763+ if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&3) - 8, 0)
764+ || (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y&3) - 8, 0)){
765765 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
766766 s->linesize, 9, 9,
767767 src_x, src_y,
libavcodec/options.c+6−6
@@ -209,11 +209,11 @@ static const AVOption options[]={ · 208 unmodified lines
209209 {"very_aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},
210210 {"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, V|D, "er"},
211211 #endif /* FF_API_ER */
212−{"err_filter", "set error detection filter flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, A|V|D, "err_filter"},
213−{"crccheck", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, V|D, "err_filter"},
214−{"bitstream", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, V|D, "err_filter"},
215−{"buffer", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BUFFER }, INT_MIN, INT_MAX, V|D, "err_filter"},
216−{"explode", "abort decoding on minor error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_filter"},
212+{"err_detect", "set error detection flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
213+{"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, V|D, "err_detect"},
214+{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, V|D, "err_detect"},
215+{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BUFFER }, INT_MIN, INT_MAX, V|D, "err_detect"},
216+{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_detect"},
217217 {"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
218218 {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
219219 #if FF_API_PARSE_FRAME
@@ -373,7 +373,7 @@ static const AVOption options[]={ · 153 unmodified lines
373373 {"float", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FLOAT }, INT_MIN, INT_MAX, V|D, "aa"},
374374 #endif
375375 {"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
376−{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|E|D, "threads"},
376+{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.dbl = 1 }, 0, INT_MAX, V|E|D, "threads"},
377377 {"auto", "detect a good number of threads", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
378378 {"me_threshold", "motion estimaton threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
379379 {"mb_threshold", "macroblock threshold", OFFSET(mb_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
libavcodec/pthread.c+21−3
@@ -420,7 +420,6 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, · 419 unmodified lines
420420
421421 dst->has_b_frames = src->has_b_frames;
422422 dst->idct_algo = src->idct_algo;
423− dst->slice_count = src->slice_count;
424423
425424 dst->bits_per_coded_sample = src->bits_per_coded_sample;
426425 dst->sample_aspect_ratio = src->sample_aspect_ratio;
@@ -455,8 +454,9 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, · 28 unmodified lines
455454 *
456455 * @param dst The destination context.
457456 * @param src The source context.
457+ * @return 0 on success, negative error code on failure
458458 */
459−static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
459+static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
460460 {
461461 #define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);
462462 dst->flags = src->flags;
@@ -478,6 +478,22 @@ static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src) · 15 unmodified lines
478478 dst->frame_number = src->frame_number;
479479 dst->reordered_opaque = src->reordered_opaque;
480480 dst->thread_safe_callbacks = src->thread_safe_callbacks;
481+
482+ if (src->slice_count && src->slice_offset) {
483+ if (dst->slice_count < src->slice_count) {
484+ int *tmp = av_realloc(dst->slice_offset, src->slice_count *
485+ sizeof(*dst->slice_offset));
486+ if (!tmp) {
487+ av_free(dst->slice_offset);
488+ return AVERROR(ENOMEM);
489+ }
490+ dst->slice_offset = tmp;
491+ }
492+ memcpy(dst->slice_offset, src->slice_offset,
493+ src->slice_count * sizeof(*dst->slice_offset));
494+ }
495+ dst->slice_count = src->slice_count;
496+ return 0;
481497 #undef copy_fields
482498 }
483499
@@ -588,7 +604,8 @@ int ff_thread_decode_frame(AVCodecContext *avctx, · 104 unmodified lines
588604 */
589605
590606 p = &fctx->threads[fctx->next_decoding];
591− update_context_from_user(p->avctx, avctx);
607+ err = update_context_from_user(p->avctx, avctx);
608+ if (err) return err;
592609 err = submit_packet(p, avpkt);
593610 if (err) return err;
594611
@@ -764,6 +781,7 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count) · 169 unmodified lines
764781 if (i) {
765782 av_freep(&p->avctx->priv_data);
766783 av_freep(&p->avctx->internal);
784+ av_freep(&p->avctx->slice_offset);
767785 }
768786
769787 av_freep(&p->avctx);
libavformat/movenc.h+2−2
@@ -40,13 +40,13 @@ · 39 unmodified lines
4040 #define MODE_IPOD 0x20
4141
4242 typedef struct MOVIentry {
43− unsigned int size;
4443 uint64_t pos;
44+ int64_t dts;
45+ unsigned int size;
4546 unsigned int samplesInChunk;
4647 unsigned int chunkNum; ///< Chunk number if the current entry is a chunk start otherwise 0
4748 unsigned int entries;
4849 int cts;
49− int64_t dts;
5050 #define MOV_SYNC_SAMPLE 0x0001
5151 #define MOV_PARTIAL_SYNC_SAMPLE 0x0002
5252 uint32_t flags;
libavformat/options.c+8−3
@@ -112,13 +112,18 @@ static const AVOption options[]={ · 111 unmodified lines
112112 {"fdebug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, INT_MAX, E|D, "fdebug"},
113113 {"ts", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, "fdebug"},
114114 {"max_delay", "maximum muxing or demuxing delay in microseconds", OFFSET(max_delay), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E|D},
115−{"fer", "set error detection aggressivity", OFFSET(error_recognition), AV_OPT_TYPE_INT, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, D, "fer"},
116−{"careful", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, D, "fer"},
117−{"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, D, "fer"},
118115 {"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX-1, D},
119116 {"audio_preload", "microseconds by which audio packets should be interleaved earlier", OFFSET(audio_preload), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX-1, E},
120117 {"chunk_duration", "microseconds for each chunk", OFFSET(max_chunk_duration), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX-1, E},
121118 {"chunk_size", "size in bytes for each chunk", OFFSET(max_chunk_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX-1, E},
119+/* this is a crutch for avconv, since it cannot deal with identically named options in different contexts.
120+ * to be removed when avconv is fixed */
121+{"f_err_detect", "set error detection flags (deprecated; use err_detect, save via avconv)", OFFSET(error_recognition), AV_OPT_TYPE_FLAGS, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, "err_detect"},
122+{"err_detect", "set error detection flags", OFFSET(error_recognition), AV_OPT_TYPE_FLAGS, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, "err_detect"},
123+{"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, "err_detect"},
124+{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, D, "err_detect"},
125+{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BUFFER }, INT_MIN, INT_MAX, D, "err_detect"},
126+{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_EXPLODE }, INT_MIN, INT_MAX, D, "err_detect"},
122127 {NULL},
123128 };
124129
libavformat/rtpdec.c+1−1
@@ -299,7 +299,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count) · 298 unmodified lines
299299 avio_w8(pb, RTCP_SDES);
300300 len = strlen(s->hostname);
301301 avio_wb16(pb, (6 + len + 3) / 4); /* length in words - 1 */
302− avio_wb32(pb, s->ssrc);
302+ avio_wb32(pb, s->ssrc + 1);
303303 avio_w8(pb, 0x01);
304304 avio_w8(pb, len);
305305 avio_write(pb, s->hostname, len);
libavformat/rtsp.h+0−3
@@ -405,9 +405,6 @@ typedef struct RTSPStream { · 404 unmodified lines
405405 void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
406406 RTSPState *rt, const char *method);
407407
408−extern int rtsp_rtp_port_min;
409−extern int rtsp_rtp_port_max;
410−
411408 /**
412409 * Send a command to the RTSP server without waiting for the reply.
413410 *
tools/aviocat.c+2−5
@@ -19,13 +19,9 @@ · 18 unmodified lines
1919 */
2020
2121 #include <stdio.h>
22−#include <string.h>
22+#include <stdlib.h>
2323 #include <unistd.h>
24−#include <sys/stat.h>
2524 #include "libavformat/avformat.h"
26−#include "libavformat/riff.h"
27−#include "libavutil/intreadwrite.h"
28−#include "libavutil/mathematics.h"
2925
3026 static int usage(const char *argv0, int ret)
3127 {
@@ -89,6 +85,7 @@ int main(int argc, char **argv) · 57 unmodified lines
8985 }
9086 }
9187
88+ avio_flush(output);
9289 avio_close(output);
9390 fail:
9491 avio_close(input);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t