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 @@
10.9.1.git10.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
2284 ist->st->codec->opaque = ist;2284 ist->st->codec->opaque = ist;
2285 }2285 }
2286 2286
2287 if (!av_dict_get(ist->opts, "threads", NULL, 0))
2288 av_dict_set(&ist->opts, "threads", "auto", 0);
2287 if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) {2289 if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) {
2288 snprintf(error, error_len, "Error while opening decoder for input stream #%d:%d",2290 snprintf(error, error_len, "Error while opening decoder for input stream #%d:%d",
2289 ist->file_index, ist->st->index);2291 ist->file_index, ist->st->index);
@@ -2574,6 +2576,8 @@ static int transcode_init(OutputFile *output_files, · 284 unmodified lines
2574 memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);2576 memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
2575 ost->st->codec->subtitle_header_size = dec->subtitle_header_size;2577 ost->st->codec->subtitle_header_size = dec->subtitle_header_size;
2576 }2578 }
2579 if (!av_dict_get(ost->opts, "threads", NULL, 0))
2580 av_dict_set(&ost->opts, "threads", "auto", 0);
2577 if (avcodec_open2(ost->st->codec, codec, &ost->opts) < 0) {2581 if (avcodec_open2(ost->st->codec, codec, &ost->opts) < 0) {
2578 snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",2582 snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",
2579 ost->file_index, ost->index);2583 ost->file_index, ost->index);
doc/APIchanges+5−5
@@ -13,15 +13,15 @@ libavutil: 2011-04-18 · 12 unmodified lines
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162012-xx-xx - lavc 53.34.0162012-01-15 - lavc 53.34.0
17 New audio encoding API:17 New audio encoding API:
18 xxxxxxx Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio18 b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
19 encoders.19 encoders.
20 xxxxxxx Add avcodec_fill_audio_frame() as a convenience function.20 5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
21 xxxxxxx Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().21 b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
22 Add AVCodec.encode2().22 Add AVCodec.encode2().
23 23
242012-01-xx - xxxxxxx - lavfi 2.15.0242012-01-12 - 3167dc9 - lavfi 2.15.0
25 Add a new installed header -- libavfilter/version.h -- with version macros.25 Add a new installed header -- libavfilter/version.h -- with version macros.
26 26
272011-12-08 - a502939 - lavfi 2.52.0272011-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
2266 }2266 }
2267 }2267 }
2268 2268
2269 if (!av_dict_get(opts, "threads", NULL, 0))
2270 av_dict_set(&opts, "threads", "auto", 0);
2269 if (!codec ||2271 if (!codec ||
2270 avcodec_open2(avctx, codec, &opts) < 0)2272 avcodec_open2(avctx, codec, &opts) < 0)
2271 return -1;2273 return -1;
ffserver.c+10−12
@@ -30,16 +30,13 @@ · 29 unmodified lines
30#include <string.h>30#include <string.h>
31#include <stdlib.h>31#include <stdlib.h>
32#include "libavformat/avformat.h"32#include "libavformat/avformat.h"
33// FIXME those are internal headers, avserver _really_ shouldn't use them
34#include "libavformat/ffm.h"33#include "libavformat/ffm.h"
35#include "libavformat/network.h"34#include "libavformat/network.h"
36#include "libavformat/os_support.h"35#include "libavformat/os_support.h"
37#include "libavformat/rtpdec.h"36#include "libavformat/rtpdec.h"
38#include "libavformat/rtsp.h"37#include "libavformat/rtsp.h"
38// XXX for ffio_open_dyn_packet_buffer, to be removed
39#include "libavformat/avio_internal.h"39#include "libavformat/avio_internal.h"
40#include "libavformat/internal.h"
41#include "libavformat/url.h"
42
43#include "libavutil/avstring.h"40#include "libavutil/avstring.h"
44#include "libavutil/lfg.h"41#include "libavutil/lfg.h"
45#include "libavutil/dict.h"42#include "libavutil/dict.h"
@@ -877,7 +874,7 @@ static void close_connection(HTTPContext *c) · 831 unmodified lines
877 }874 }
878 h = c->rtp_handles[i];875 h = c->rtp_handles[i];
879 if (h)876 if (h)
880 ffurl_close(h);877 url_close(h);
881 }878 }
882 879
883 ctx = &c->fmt_ctx;880 ctx = &c->fmt_ctx;
@@ -2258,6 +2255,7 @@ static int http_prepare_data(HTTPContext *c) · 1374 unmodified lines
2258 * Default value from FFmpeg2255 * Default value from FFmpeg
2259 * Try to set it use configuration option2256 * Try to set it use configuration option
2260 */2257 */
2258 c->fmt_ctx.preload = (int)(0.5*AV_TIME_BASE);
2261 c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE);2259 c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE);
2262 2260
2263 if (avformat_write_header(&c->fmt_ctx, NULL) < 0) {2261 if (avformat_write_header(&c->fmt_ctx, NULL) < 0) {
@@ -2376,7 +2374,7 @@ static int http_prepare_data(HTTPContext *c) · 112 unmodified lines
2376 if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP)2374 if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP)
2377 max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;2375 max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
2378 else2376 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]);
2380 ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size);2378 ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size);
2381 } else {2379 } else {
2382 ret = avio_open_dyn_buf(&ctx->pb);2380 ret = avio_open_dyn_buf(&ctx->pb);
@@ -2529,8 +2527,8 @@ static int http_send_data(HTTPContext *c) · 146 unmodified lines
2529 } else {2527 } else {
2530 /* send RTP packet directly in UDP */2528 /* send RTP packet directly in UDP */
2531 c->buffer_ptr += 4;2529 c->buffer_ptr += 4;
2532 ffurl_write(c->rtp_handles[c->packet_stream_index],2530 url_write(c->rtp_handles[c->packet_stream_index],
2533 c->buffer_ptr, len);2531 c->buffer_ptr, len);
2534 c->buffer_ptr += len;2532 c->buffer_ptr += len;
2535 /* here we continue as we can send several packets per 10 ms slot */2533 /* here we continue as we can send several packets per 10 ms slot */
2536 }2534 }
@@ -3413,10 +3411,10 @@ static int rtp_new_av_stream(HTTPContext *c, · 876 unmodified lines
3413 "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));3411 "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
3414 }3412 }
3415 3413
3416 if (ffurl_open(&h, ctx->filename, AVIO_FLAG_WRITE, NULL, NULL) < 0)3414 if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0)
3417 goto fail;3415 goto fail;
3418 c->rtp_handles[stream_index] = h;3416 c->rtp_handles[stream_index] = h;
3419 max_packet_size = h->max_packet_size;3417 max_packet_size = url_get_max_packet_size(h);
3420 break;3418 break;
3421 case RTSP_LOWER_TRANSPORT_TCP:3419 case RTSP_LOWER_TRANSPORT_TCP:
3422 /* RTP/TCP case */3420 /* RTP/TCP case */
@@ -3439,7 +3437,7 @@ static int rtp_new_av_stream(HTTPContext *c, · 16 unmodified lines
3439 if (avformat_write_header(ctx, NULL) < 0) {3437 if (avformat_write_header(ctx, NULL) < 0) {
3440 fail:3438 fail:
3441 if (h)3439 if (h)
3442 ffurl_close(h);3440 url_close(h);
3443 av_free(ctx);3441 av_free(ctx);
3444 return -1;3442 return -1;
3445 }3443 }
@@ -3476,7 +3474,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop · 30 unmodified lines
3476 }3474 }
3477 fst->priv_data = av_mallocz(sizeof(FeedData));3475 fst->priv_data = av_mallocz(sizeof(FeedData));
3478 fst->index = stream->nb_streams;3476 fst->index = stream->nb_streams;
3479 avpriv_set_pts_info(fst, 33, 1, 90000);3477 av_set_pts_info(fst, 33, 1, 90000);
3480 fst->sample_aspect_ratio = codec->sample_aspect_ratio;3478 fst->sample_aspect_ratio = codec->sample_aspect_ratio;
3481 stream->streams[stream->nb_streams++] = fst;3479 stream->streams[stream->nb_streams++] = fst;
3482 return fst;3480 return fst;
libavcodec/mpegaudiodec.c+2−2
@@ -987,10 +987,10 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g, · 986 unmodified lines
987 /* skip extension bits */987 /* skip extension bits */
988 bits_left = end_pos2 - get_bits_count(&s->gb);988 bits_left = end_pos2 - get_bits_count(&s->gb);
989//av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer);989//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))) {
991 av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);991 av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
992 s_index=0;992 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))) {
994 av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);994 av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
995 s_index = 0;995 s_index = 0;
996 }996 }
libavcodec/mpegvideo.c+6−6
@@ -1805,8 +1805,8 @@ static inline int hpel_motion_lowres(MpegEncContext *s, · 1804 unmodified lines
1805 1805
1806 src += src_y * stride + src_x;1806 src += src_y * stride + src_x;
1807 1807
1808 if ((unsigned)src_x > h_edge_pos - (!!sx) - w ||1808 if ((unsigned)src_x > FFMAX( h_edge_pos - (!!sx) - w, 0) ||
1809 (unsigned)src_y > (v_edge_pos >> field_based) - (!!sy) - h) {1809 (unsigned)src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
1810 s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w + 1,1810 s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w + 1,
1811 (h + 1) << field_based, src_x,1811 (h + 1) << field_based, src_x,
1812 src_y << field_based,1812 src_y << field_based,
@@ -1907,8 +1907,8 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, · 94 unmodified lines
1907 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;1907 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
1908 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;1908 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
1909 1909
1910 if ((unsigned) src_x > h_edge_pos - (!!sx) - 2 * block_s ||1910 if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) ||
1911 (unsigned) src_y > (v_edge_pos >> field_based) - (!!sy) - h) {1911 (unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
1912 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,1912 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
1913 s->linesize, 17, 17 + field_based,1913 s->linesize, 17, 17 + field_based,
1914 src_x, src_y << field_based, h_edge_pos,1914 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
1990 offset = src_y * s->uvlinesize + src_x;1990 offset = src_y * s->uvlinesize + src_x;
1991 ptr = ref_picture[1] + offset;1991 ptr = ref_picture[1] + offset;
1992 if (s->flags & CODEC_FLAG_EMU_EDGE) {1992 if (s->flags & CODEC_FLAG_EMU_EDGE) {
1993 if ((unsigned) src_x > h_edge_pos - (!!sx) - block_s ||1993 if ((unsigned) src_x > FFMAX(h_edge_pos - (!!sx) - block_s, 0) ||
1994 (unsigned) src_y > v_edge_pos - (!!sy) - block_s) {1994 (unsigned) src_y > FFMAX(v_edge_pos - (!!sy) - block_s, 0)) {
1995 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,1995 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
1996 9, 9, src_x, src_y, h_edge_pos, v_edge_pos);1996 9, 9, src_x, src_y, h_edge_pos, v_edge_pos);
1997 ptr = s->edge_emu_buffer;1997 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
81 ptr = ref_picture[0] + (src_y * linesize) + src_x;81 ptr = ref_picture[0] + (src_y * linesize) + src_x;
82 82
83 if(s->flags&CODEC_FLAG_EMU_EDGE){83 if(s->flags&CODEC_FLAG_EMU_EDGE){
84 if( (unsigned)src_x >= s->h_edge_pos - 1784 if( (unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0)
85 || (unsigned)src_y >= s->v_edge_pos - 17){85 || (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)){
86 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);86 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);
87 ptr= s->edge_emu_buffer;87 ptr= s->edge_emu_buffer;
88 }88 }
@@ -120,8 +120,8 @@ static inline void gmc1_motion(MpegEncContext *s, · 31 unmodified lines
120 offset = (src_y * uvlinesize) + src_x;120 offset = (src_y * uvlinesize) + src_x;
121 ptr = ref_picture[1] + offset;121 ptr = ref_picture[1] + offset;
122 if(s->flags&CODEC_FLAG_EMU_EDGE){122 if(s->flags&CODEC_FLAG_EMU_EDGE){
123 if( (unsigned)src_x >= (s->h_edge_pos>>1) - 9123 if( (unsigned)src_x >= FFMAX((s->h_edge_pos>>1) - 9, 0)
124 || (unsigned)src_y >= (s->v_edge_pos>>1) - 9){124 || (unsigned)src_y >= FFMAX((s->v_edge_pos>>1) - 9, 0)){
125 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);125 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);
126 ptr= s->edge_emu_buffer;126 ptr= s->edge_emu_buffer;
127 emu=1;127 emu=1;
@@ -221,8 +221,8 @@ static inline int hpel_motion(MpegEncContext *s, · 93 unmodified lines
221 src += src_y * stride + src_x;221 src += src_y * stride + src_x;
222 222
223 if(s->unrestricted_mv && (s->flags&CODEC_FLAG_EMU_EDGE)){223 if(s->unrestricted_mv && (s->flags&CODEC_FLAG_EMU_EDGE)){
224 if( (unsigned)src_x > h_edge_pos - (motion_x&1) - w224 if( (unsigned)src_x > FFMAX(h_edge_pos - (motion_x&1) - w, 0)
225 || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){225 || (unsigned)src_y > FFMAX(v_edge_pos - (motion_y&1) - h, 0)){
226 s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w+1, (h+1)<<field_based,226 s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w+1, (h+1)<<field_based,
227 src_x, src_y<<field_based, h_edge_pos, s->v_edge_pos);227 src_x, src_y<<field_based, h_edge_pos, s->v_edge_pos);
228 src= s->edge_emu_buffer;228 src= s->edge_emu_buffer;
@@ -307,8 +307,8 @@ if(s->quarter_sample) · 78 unmodified lines
307 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;307 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
308 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;308 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
309 309
310 if( (unsigned)src_x > s->h_edge_pos - (motion_x&1) - 16310 if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&1) - 16, 0)
311 || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){311 || (unsigned)src_y > FFMAX( v_edge_pos - (motion_y&1) - h , 0)){
312 if(is_mpeg12 || s->codec_id == CODEC_ID_MPEG2VIDEO ||312 if(is_mpeg12 || s->codec_id == CODEC_ID_MPEG2VIDEO ||
313 s->codec_id == CODEC_ID_MPEG1VIDEO){313 s->codec_id == CODEC_ID_MPEG1VIDEO){
314 av_log(s->avctx,AV_LOG_DEBUG,314 av_log(s->avctx,AV_LOG_DEBUG,
@@ -510,8 +510,8 @@ static inline void qpel_motion(MpegEncContext *s, · 195 unmodified lines
510 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;510 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
511 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;511 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
512 512
513 if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16513 if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&3) - 16, 0)
514 || (unsigned)src_y > v_edge_pos - (motion_y&3) - h ){514 || (unsigned)src_y > FFMAX( v_edge_pos - (motion_y&3) - h , 0)){
515 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,515 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
516 17, 17+field_based, src_x, src_y<<field_based,516 17, 17+field_based, src_x, src_y<<field_based,
517 s->h_edge_pos, s->v_edge_pos);517 s->h_edge_pos, s->v_edge_pos);
@@ -588,8 +588,8 @@ static inline void chroma_4mv_motion(MpegEncContext *s, · 70 unmodified lines
588 offset = src_y * s->uvlinesize + src_x;588 offset = src_y * s->uvlinesize + src_x;
589 ptr = ref_picture[1] + offset;589 ptr = ref_picture[1] + offset;
590 if(s->flags&CODEC_FLAG_EMU_EDGE){590 if(s->flags&CODEC_FLAG_EMU_EDGE){
591 if( (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8591 if( (unsigned)src_x > FFMAX((s->h_edge_pos>>1) - (dxy &1) - 8, 0)
592 || (unsigned)src_y > (s->v_edge_pos>>1) - (dxy>>1) - 8){592 || (unsigned)src_y > FFMAX((s->v_edge_pos>>1) - (dxy>>1) - 8, 0)){
593 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,593 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
594 9, 9, src_x, src_y,594 9, 9, src_x, src_y,
595 s->h_edge_pos>>1, s->v_edge_pos>>1);595 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
760 760
761 ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);761 ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
762 if(s->flags&CODEC_FLAG_EMU_EDGE){762 if(s->flags&CODEC_FLAG_EMU_EDGE){
763 if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8763 if( (unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x&3) - 8, 0)
764 || (unsigned)src_y > s->v_edge_pos - (motion_y&3) - 8 ){764 || (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y&3) - 8, 0)){
765 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr,765 s->dsp.emulated_edge_mc(s->edge_emu_buffer, ptr,
766 s->linesize, 9, 9,766 s->linesize, 9, 9,
767 src_x, src_y,767 src_x, src_y,
libavcodec/options.c+6−6
@@ -209,11 +209,11 @@ static const AVOption options[]={ · 208 unmodified lines
209{"very_aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},209{"very_aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},
210{"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, V|D, "er"},210{"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, V|D, "er"},
211#endif /* FF_API_ER */211#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"},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", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, V|D, "err_filter"},213{"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, V|D, "err_detect"},
214{"bitstream", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, V|D, "err_filter"},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", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BUFFER }, INT_MIN, INT_MAX, V|D, "err_filter"},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 recognition", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_filter"},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"},
217{"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},217{"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
218{"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},218{"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
219#if FF_API_PARSE_FRAME219#if FF_API_PARSE_FRAME
@@ -373,7 +373,7 @@ static const AVOption options[]={ · 153 unmodified lines
373{"float", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FLOAT }, INT_MIN, INT_MAX, V|D, "aa"},373{"float", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FLOAT }, INT_MIN, INT_MAX, V|D, "aa"},
374#endif374#endif
375{"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},375{"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"},
377{"auto", "detect a good number of threads", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},377{"auto", "detect a good number of threads", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
378{"me_threshold", "motion estimaton threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},378{"me_threshold", "motion estimaton threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
379{"mb_threshold", "macroblock threshold", OFFSET(mb_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},379{"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
420 420
421 dst->has_b_frames = src->has_b_frames;421 dst->has_b_frames = src->has_b_frames;
422 dst->idct_algo = src->idct_algo;422 dst->idct_algo = src->idct_algo;
423 dst->slice_count = src->slice_count;
424 423
425 dst->bits_per_coded_sample = src->bits_per_coded_sample;424 dst->bits_per_coded_sample = src->bits_per_coded_sample;
426 dst->sample_aspect_ratio = src->sample_aspect_ratio;425 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
455 *454 *
456 * @param dst The destination context.455 * @param dst The destination context.
457 * @param src The source context.456 * @param src The source context.
457 * @return 0 on success, negative error code on failure
458 */458 */
459static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src)459static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src)
460{460{
461#define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);461#define copy_fields(s, e) memcpy(&dst->s, &src->s, (char*)&dst->e - (char*)&dst->s);
462 dst->flags = src->flags;462 dst->flags = src->flags;
@@ -478,6 +478,22 @@ static void update_context_from_user(AVCodecContext *dst, AVCodecContext *src) · 15 unmodified lines
478 dst->frame_number = src->frame_number;478 dst->frame_number = src->frame_number;
479 dst->reordered_opaque = src->reordered_opaque;479 dst->reordered_opaque = src->reordered_opaque;
480 dst->thread_safe_callbacks = src->thread_safe_callbacks;480 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;
481#undef copy_fields497#undef copy_fields
482}498}
483 499
@@ -588,7 +604,8 @@ int ff_thread_decode_frame(AVCodecContext *avctx, · 104 unmodified lines
588 */604 */
589 605
590 p = &fctx->threads[fctx->next_decoding];606 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;
592 err = submit_packet(p, avpkt);609 err = submit_packet(p, avpkt);
593 if (err) return err;610 if (err) return err;
594 611
@@ -764,6 +781,7 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count) · 169 unmodified lines
764 if (i) {781 if (i) {
765 av_freep(&p->avctx->priv_data);782 av_freep(&p->avctx->priv_data);
766 av_freep(&p->avctx->internal);783 av_freep(&p->avctx->internal);
784 av_freep(&p->avctx->slice_offset);
767 }785 }
768 786
769 av_freep(&p->avctx);787 av_freep(&p->avctx);
libavformat/movenc.h+2−2
@@ -40,13 +40,13 @@ · 39 unmodified lines
40#define MODE_IPOD 0x2040#define MODE_IPOD 0x20
41 41
42typedef struct MOVIentry {42typedef struct MOVIentry {
43 unsigned int size;
44 uint64_t pos;43 uint64_t pos;
44 int64_t dts;
45 unsigned int size;
45 unsigned int samplesInChunk;46 unsigned int samplesInChunk;
46 unsigned int chunkNum; ///< Chunk number if the current entry is a chunk start otherwise 047 unsigned int chunkNum; ///< Chunk number if the current entry is a chunk start otherwise 0
47 unsigned int entries;48 unsigned int entries;
48 int cts;49 int cts;
49 int64_t dts;
50#define MOV_SYNC_SAMPLE 0x000150#define MOV_SYNC_SAMPLE 0x0001
51#define MOV_PARTIAL_SYNC_SAMPLE 0x000251#define MOV_PARTIAL_SYNC_SAMPLE 0x0002
52 uint32_t flags;52 uint32_t flags;
libavformat/options.c+8−3
@@ -112,13 +112,18 @@ static const AVOption options[]={ · 111 unmodified lines
112{"fdebug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, INT_MAX, E|D, "fdebug"},112{"fdebug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, INT_MAX, E|D, "fdebug"},
113{"ts", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, "fdebug"},113{"ts", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, "fdebug"},
114{"max_delay", "maximum muxing or demuxing delay in microseconds", OFFSET(max_delay), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E|D},114{"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"},
118{"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX-1, D},115{"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX-1, D},
119{"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},116{"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},
120{"chunk_duration", "microseconds for each chunk", OFFSET(max_chunk_duration), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX-1, E},117{"chunk_duration", "microseconds for each chunk", OFFSET(max_chunk_duration), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX-1, E},
121{"chunk_size", "size in bytes for each chunk", OFFSET(max_chunk_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX-1, E},118{"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"},
122{NULL},127{NULL},
123};128};
124 129
libavformat/rtpdec.c+1−1
@@ -299,7 +299,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count) · 298 unmodified lines
299 avio_w8(pb, RTCP_SDES);299 avio_w8(pb, RTCP_SDES);
300 len = strlen(s->hostname);300 len = strlen(s->hostname);
301 avio_wb16(pb, (6 + len + 3) / 4); /* length in words - 1 */301 avio_wb16(pb, (6 + len + 3) / 4); /* length in words - 1 */
302 avio_wb32(pb, s->ssrc);302 avio_wb32(pb, s->ssrc + 1);
303 avio_w8(pb, 0x01);303 avio_w8(pb, 0x01);
304 avio_w8(pb, len);304 avio_w8(pb, len);
305 avio_write(pb, s->hostname, len);305 avio_write(pb, s->hostname, len);
libavformat/rtsp.h+0−3
@@ -405,9 +405,6 @@ typedef struct RTSPStream { · 404 unmodified lines
405void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,405void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
406 RTSPState *rt, const char *method);406 RTSPState *rt, const char *method);
407 407
408extern int rtsp_rtp_port_min;
409extern int rtsp_rtp_port_max;
410
411/**408/**
412 * Send a command to the RTSP server without waiting for the reply.409 * Send a command to the RTSP server without waiting for the reply.
413 *410 *
tools/aviocat.c+2−5
@@ -19,13 +19,9 @@ · 18 unmodified lines
19 */19 */
20 20
21#include <stdio.h>21#include <stdio.h>
22#include <string.h>22#include <stdlib.h>
23#include <unistd.h>23#include <unistd.h>
24#include <sys/stat.h>
25#include "libavformat/avformat.h"24#include "libavformat/avformat.h"
26#include "libavformat/riff.h"
27#include "libavutil/intreadwrite.h"
28#include "libavutil/mathematics.h"
29 25
30static int usage(const char *argv0, int ret)26static int usage(const char *argv0, int ret)
31{27{
@@ -89,6 +85,7 @@ int main(int argc, char **argv) · 57 unmodified lines
89 }85 }
90 }86 }
91 87
88 avio_flush(output);
92 avio_close(output);89 avio_close(output);
93fail:90fail:
94 avio_close(input);91 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