[FFmpeg-cvslog] idoc/examples/remuxing: Use avio_closep() in examples as it avoids leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Thu Jan 8 05:10:39 2015 +0100| [a63c17cec723542a93726fd299187d4c71b24c25] | committer: Michael Niedermayer idoc/examples/remuxing: Use avio_closep() in examples as it avoids leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a63c17cec723542a93726fd299187d4c71b24c25 --- doc/examples/remuxing.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/remuxing.c b/doc/examples/remuxing.c index 39d9dee..e9758a8 100644 --- a/doc/examples/remuxing.c +++ b/doc/examples/remuxing.c @@ -153,7 +153,7 @@ end: /* close output */ if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE)) -avio_close(ofmt_ctx->pb); +avio_closep(&ofmt_ctx->pb); avformat_free_context(ofmt_ctx); if (ret < 0 && ret != AVERROR_EOF) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/examples/transcode_aac: Use avio_closep() in examples as it avoids leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Thu Jan 8 05:09:52 2015 +0100| [c61b84ccfda148c325766ee82f26f9231a893420] | committer: Michael Niedermayer doc/examples/transcode_aac: Use avio_closep() in examples as it avoids leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c61b84ccfda148c325766ee82f26f9231a893420 --- doc/examples/transcode_aac.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index e98c217..6998aac 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -199,7 +199,7 @@ static int open_output_file(const char *filename, return 0; cleanup: -avio_close((*output_format_context)->pb); +avio_closep(&(*output_format_context)->pb); avformat_free_context(*output_format_context); *output_format_context = NULL; return error < 0 ? error : AVERROR_EXIT; @@ -743,7 +743,7 @@ cleanup: if (output_codec_context) avcodec_close(output_codec_context); if (output_format_context) { -avio_close(output_format_context->pb); +avio_closep(&output_format_context->pb); avformat_free_context(output_format_context); } if (input_codec_context) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/examples/muxing: Use avio_closep() in examples as it avoids leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Thu Jan 8 05:09:06 2015 +0100| [1d2410639d9da4e7711a79f03d1ce512195aff88] | committer: Michael Niedermayer doc/examples/muxing: Use avio_closep() in examples as it avoids leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d2410639d9da4e7711a79f03d1ce512195aff88 --- doc/examples/muxing.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index 3ec2eb6..8b0ea60 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -661,7 +661,7 @@ int main(int argc, char **argv) if (!(fmt->flags & AVFMT_NOFILE)) /* Close the output file. */ -avio_close(oc->pb); +avio_closep(&oc->pb); /* free the stream */ avformat_free_context(oc); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/examples/transcoding: Use avio_closep() in examples as it avoids leaving stale pointers
ffmpeg | branch: master | Michael Niedermayer | Thu Jan 8 05:10:55 2015 +0100| [a85f033149a680cff101caea82d95577e4bd10ca] | committer: Michael Niedermayer doc/examples/transcoding: Use avio_closep() in examples as it avoids leaving stale pointers Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a85f033149a680cff101caea82d95577e4bd10ca --- doc/examples/transcoding.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c index 5572461..2a8220e 100644 --- a/doc/examples/transcoding.c +++ b/doc/examples/transcoding.c @@ -573,7 +573,7 @@ end: av_free(filter_ctx); avformat_close_input(&ifmt_ctx); if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) -avio_close(ofmt_ctx->pb); +avio_closep(&ofmt_ctx->pb); avformat_free_context(ofmt_ctx); if (ret < 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc: fix typos
ffmpeg | branch: master | Lou Logan | Wed Jan 7 17:16:54 2015 -0900| [919e038a95fdebefb0ec76a602c0d61758ad0d8d] | committer: Lou Logan doc: fix typos Signed-off-by: Lou Logan > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=919e038a95fdebefb0ec76a602c0d61758ad0d8d --- doc/codecs.texi|2 +- doc/developer.texi |4 ++-- doc/encoders.texi |2 +- doc/indevs.texi|2 +- doc/muxers.texi|2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/codecs.texi b/doc/codecs.texi index f1f5c00..4105e09 100644 --- a/doc/codecs.texi +++ b/doc/codecs.texi @@ -7,7 +7,7 @@ all the encoders and decoders. In addition each codec may support so-called private options, which are specific for a given codec. Sometimes, a global option may only affect a specific kind of codec, -and may be unsensical or ignored by another, so you need to be aware +and may be nonsensical or ignored by another, so you need to be aware of the meaning of the specified options. Also some options are meant only for decoding or encoding. diff --git a/doc/developer.texi b/doc/developer.texi index 8b1f150..f1351a5 100644 --- a/doc/developer.texi +++ b/doc/developer.texi @@ -647,12 +647,12 @@ accordingly]. @subsection Adding files to the fate-suite dataset When there is no muxer or encoder available to generate test media for a -specific test then the media has to be inlcuded in the fate-suite. +specific test then the media has to be included in the fate-suite. First please make sure that the sample file is as small as possible to test the respective decoder or demuxer sufficiently. Large files increase network bandwidth and disk space requirements. Once you have a working fate test and fate sample, provide in the commit -message or introductionary message for the patch series that you post to +message or introductory message for the patch series that you post to the ffmpeg-devel mailing list, a direct link to download the sample media. diff --git a/doc/encoders.texi b/doc/encoders.texi index c0e9890..a6cdd99 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -2171,7 +2171,7 @@ Use @var{0} to disable alpha plane coding. @subsection Speed considerations In the default mode of operation the encoder has to honor frame constraints -(i.e. not produc frames with size bigger than requested) while still making +(i.e. not produce frames with size bigger than requested) while still making output picture as good as possible. A frame containing a lot of small details is harder to compress and the encoder would spend more time searching for appropriate quantizers for each slice. diff --git a/doc/indevs.texi b/doc/indevs.texi index abc4cc3..fa6facf 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -390,7 +390,7 @@ not work and result in undefined behavior. The values @option{auto}, @option{dv} and @option{hdv} are supported. @item dvbuffer -Set maxiumum size of buffer for incoming data, in frames. For DV, this +Set maximum size of buffer for incoming data, in frames. For DV, this is an exact value. For HDV, it is not frame exact, since HDV does not have a fixed frame size. diff --git a/doc/muxers.texi b/doc/muxers.texi index a1264d2..e356235 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -781,7 +781,7 @@ Change the syncpoint usage in nut: sensitive and seeking is not possible. Also in general the overhead from syncpoints is negligible. Note, -@code{write_index} 0 can be used to disable all growing data tables, allowing to mux endless streams with limited memory -and wihout these disadvantages. +and without these disadvantages. @item @var{timestamped} extend the syncpoint with a wallclock field. @end table The @var{none} and @var{timestamped} flags are experimental. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dvdsubdec: error on bitmaps with size 0
ffmpeg | branch: master | wm4 | Wed Jan 7 23:57:50 2015 +0100| [bcaa9099b3648b47060e1724a97dc98b63c83702] | committer: Michael Niedermayer avcodec/dvdsubdec: error on bitmaps with size 0 Attemtping to decode them could lead to invalid writes with some fuzzed samples. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bcaa9099b3648b47060e1724a97dc98b63c83702 --- libavcodec/dvdsubdec.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 2423cad..1cc34ea 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -111,6 +111,9 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, if (start >= buf_size) return -1; +if (w <= 0 || h <= 0) +return -1; + bit_len = (buf_size - start) * 8; init_get_bits(&gb, buf + start, bit_len); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '5a1addd7c1d8ff218ed4b84f4f02fdb83980094c'
ffmpeg | branch: master | Michael Niedermayer | Thu Jan 8 00:04:17 2015 +0100| [3ed80bd95e1dd6864dbd08fa622d7eec97ac9a38] | committer: Michael Niedermayer Merge commit '5a1addd7c1d8ff218ed4b84f4f02fdb83980094c' * commit '5a1addd7c1d8ff218ed4b84f4f02fdb83980094c': xsub: Support DXSA subtitles Conflicts: libavcodec/xsubdec.c See: d6f910ea47255b519e0b71c33d74c409a29ab3db Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ed80bd95e1dd6864dbd08fa622d7eec97ac9a38 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] xsub: Support DXSA subtitles
ffmpeg | branch: master | Alexandre Colucci | Wed Jan 7 12:18:08 2015 +0100| [5a1addd7c1d8ff218ed4b84f4f02fdb83980094c] | committer: Luca Barbato xsub: Support DXSA subtitles These have a DXSA tag and contain alpha in addition to color values for palette. Signed-off-by: Jean-Baptiste Kempf Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a1addd7c1d8ff218ed4b84f4f02fdb83980094c --- libavcodec/xsubdec.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 3d85973..d01b410 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -56,11 +56,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, int w, h, x, y, i; int64_t packet_time = 0; GetBitContext gb; +int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A'); memset(sub, 0, sizeof(*sub)); // check that at least header fits -if (buf_size < 27 + 7 * 2 + 4 * 3) { +if (buf_size < 27 + 7 * 2 + 4 * (3 + has_alpha)) { av_log(avctx, AV_LOG_ERROR, "coded frame too small\n"); return -1; } @@ -107,9 +108,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, // read palette for (i = 0; i < sub->rects[0]->nb_colors; i++) ((uint32_t*)sub->rects[0]->pict.data[1])[i] = bytestream_get_be24(&buf); -// make all except background (first entry) non-transparent -for (i = 1; i < sub->rects[0]->nb_colors; i++) -((uint32_t*)sub->rects[0]->pict.data[1])[i] |= 0xff00; + +if (!has_alpha) { +// make all except background (first entry) non-transparent +for (i = 1; i < sub->rects[0]->nb_colors; i++) +((uint32_t *)sub->rects[0]->pict.data[1])[i] |= 0xff00; +} else { +for (i = 0; i < sub->rects[0]->nb_colors; i++) +((uint32_t *)sub->rects[0]->pict.data[1])[i] |= *buf++ << 24; +} // process RLE-compressed data init_get_bits(&gb, buf, (buf_end - buf) * 8); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '01168bf1405ddbf671f1074a927b951b8777adbb'
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 22:48:15 2015 +0100| [0e1bb03cb034fcdc83f964fd8ca5e98c569078be] | committer: Michael Niedermayer Merge commit '01168bf1405ddbf671f1074a927b951b8777adbb' * commit '01168bf1405ddbf671f1074a927b951b8777adbb': mpeg: Remove unused field Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e1bb03cb034fcdc83f964fd8ca5e98c569078be --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mpeg: Remove unused field
ffmpeg | branch: master | Luca Barbato | Tue Dec 30 23:17:17 2014 +0100| [01168bf1405ddbf671f1074a927b951b8777adbb] | committer: Luca Barbato mpeg: Remove unused field > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01168bf1405ddbf671f1074a927b951b8777adbb --- libavformat/mpegenc.c |1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 9640893..1c68a8f 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -43,7 +43,6 @@ typedef struct PacketDesc { int64_t dts; int size; int unwritten_size; -int flags; struct PacketDesc *next; } PacketDesc; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/segment: Clear contexts after deallocation
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 22:29:16 2015 +0100| [e2404096b02e8ccba4979ec5ba2399ff5143187b] | committer: Michael Niedermayer avformat/segment: Clear contexts after deallocation Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e2404096b02e8ccba4979ec5ba2399ff5143187b --- libavformat/segment.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavformat/segment.c b/libavformat/segment.c index 1aac581..0ee65bb 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -357,7 +357,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) av_freep(&entry); } -avio_close(seg->list_pb); +avio_closep(&seg->list_pb); if ((ret = segment_list_open(s)) < 0) goto end; for (entry = seg->segment_list_entries; entry; entry = entry->next) @@ -375,7 +375,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) seg->segment_count++; end: -avio_close(oc->pb); +avio_closep(&oc->pb); return ret; } @@ -688,7 +688,7 @@ static int seg_write_header(AVFormatContext *s) } if (ret < 0) { -avio_close(oc->pb); +avio_closep(&oc->pb); goto fail; } seg->segment_frame_count = 0; @@ -849,7 +849,7 @@ static int seg_write_trailer(struct AVFormatContext *s) } fail: if (seg->list) -avio_close(seg->list_pb); +avio_closep(&seg->list_pb); av_dict_free(&seg->format_options); av_opt_free(seg); @@ -865,6 +865,7 @@ fail: } avformat_free_context(oc); +seg->avf = NULL; return ret; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] segment: Fix the failure paths
ffmpeg | branch: master | Luca Barbato | Mon Jan 5 10:40:41 2015 +0100| [b3f04657368a32a9903406395f865e230b1de348] | committer: Luca Barbato segment: Fix the failure paths A failure in segment_end() or segment_start() would lead to freeing a dangling pointer and in general further calls to seg_write_packet() or to seg_write_trailer() would have the same faulty behaviour. CC: libav-sta...@libav.org Reported-By: luodalon...@gmail.com > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b3f04657368a32a9903406395f865e230b1de348 --- libavformat/segment.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/libavformat/segment.c b/libavformat/segment.c index 52da6b9..bcfd1f9 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -184,6 +184,13 @@ static void close_null_ctx(AVIOContext *pb) av_free(pb); } +static void seg_free_context(SegmentContext *seg) +{ +avio_closep(&seg->pb); +avformat_free_context(seg->avf); +seg->avf = NULL; +} + static int seg_write_header(AVFormatContext *s) { SegmentContext *seg = s->priv_data; @@ -265,12 +272,9 @@ static int seg_write_header(AVFormatContext *s) } fail: -if (ret) { -if (seg->list) -avio_close(seg->pb); -if (seg->avf) -avformat_free_context(seg->avf); -} +if (ret < 0) +seg_free_context(seg); + return ret; } @@ -282,6 +286,9 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) int64_t end_pts = seg->recording_time * seg->number; int ret, can_split = 1; +if (!oc) +return AVERROR(EINVAL); + if (seg->has_video) { can_split = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pkt->flags & AV_PKT_FLAG_KEY; @@ -322,11 +329,8 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) ret = ff_write_chained(oc, pkt->stream_index, pkt, s); fail: -if (ret < 0) { -if (seg->list) -avio_close(seg->pb); -avformat_free_context(oc); -} +if (ret < 0) +seg_free_context(seg); return ret; } @@ -335,7 +339,11 @@ static int seg_write_trailer(struct AVFormatContext *s) { SegmentContext *seg = s->priv_data; AVFormatContext *oc = seg->avf; -int ret; +int ret = 0; + +if (!oc) +goto fail; + if (!seg->write_header_trailer) { if ((ret = segment_end(oc, 0)) < 0) goto fail; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b3f04657368a32a9903406395f865e230b1de348'
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 22:15:45 2015 +0100| [2a741baeff359aa7e8a5bb2c1a225d6ac9cf10ee] | committer: Michael Niedermayer Merge commit 'b3f04657368a32a9903406395f865e230b1de348' * commit 'b3f04657368a32a9903406395f865e230b1de348': segment: Fix the failure paths Conflicts: libavformat/segment.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a741baeff359aa7e8a5bb2c1a225d6ac9cf10ee --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/aic: Use av_malloc_array
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 19:46:16 2015 +0100| [86e7d20ac2e7cfd6385f84e78117058c1ea0882f] | committer: Michael Niedermayer avcodec/aic: Use av_malloc_array Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=86e7d20ac2e7cfd6385f84e78117058c1ea0882f --- libavcodec/aic.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aic.c b/libavcodec/aic.c index 3472301..e5e2236 100644 --- a/libavcodec/aic.c +++ b/libavcodec/aic.c @@ -448,7 +448,7 @@ static av_cold int aic_decode_init(AVCodecContext *avctx) } } -ctx->slice_data = av_malloc(ctx->slice_width * AIC_BAND_COEFFS +ctx->slice_data = av_malloc_array(ctx->slice_width, AIC_BAND_COEFFS * sizeof(*ctx->slice_data)); if (!ctx->slice_data) { av_log(avctx, AV_LOG_ERROR, "Error allocating slice buffer\n"); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/libxvid: fix potential integer overflow
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 17:23:25 2015 +0100| [e00499eb4c80752b2c464f3a98bf0b6ce7b1e212] | committer: Michael Niedermayer avcodec/libxvid: fix potential integer overflow Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e00499eb4c80752b2c464f3a98bf0b6ce7b1e212 --- libavcodec/libxvid.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 7669fee..b6840ee 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -713,7 +713,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt, xvid_enc_frame_t xvid_enc_frame = { 0 }; xvid_enc_stats_t xvid_enc_stats = { 0 }; -if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0) +if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*(int64_t)mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0) return ret; /* Start setting up the frame */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg_opt: Use av_realloc_array()
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 17:26:39 2015 +0100| [2d7fd4cc33d5b2b61fda4315d261bd72625eb252] | committer: Michael Niedermayer ffmpeg_opt: Use av_realloc_array() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d7fd4cc33d5b2b61fda4315d261bd72625eb252 --- ffmpeg_opt.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index ac93eb5..7594b34 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -1383,8 +1383,8 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in } /* FIXME realloc failure */ video_enc->rc_override = -av_realloc(video_enc->rc_override, - sizeof(RcOverride) * (i + 1)); +av_realloc_array(video_enc->rc_override, + i + 1, sizeof(RcOverride)); video_enc->rc_override[i].start_frame = start; video_enc->rc_override[i].end_frame = end; if (q > 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/dvbsub: remove unused variable
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 17:20:39 2015 +0100| [dfffc4aadc7c8c615190ddb4a08cd451ac9b1020] | committer: Michael Niedermayer avformat/dvbsub: remove unused variable Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dfffc4aadc7c8c615190ddb4a08cd451ac9b1020 --- libavformat/dvbsub.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dvbsub.c b/libavformat/dvbsub.c index 57edc31..d52bc86 100644 --- a/libavformat/dvbsub.c +++ b/libavformat/dvbsub.c @@ -29,7 +29,7 @@ static int dvbsub_probe(AVProbeData *p) { int i, j, k; const uint8_t *end = p->buf + p->buf_size; -int type, page_id, len; +int type, len; int max_score = 0; for(i=0; ibuf_size; i++){ @@ -41,7 +41,7 @@ static int dvbsub_probe(AVProbeData *p) if (*ptr != 0x0f) break; type= ptr[1]; -page_id = AV_RB16(ptr + 2); +//page_id = AV_RB16(ptr + 2); len = AV_RB16(ptr + 4); if (type == 0x80) { ; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg_opt: Check for av_realloc_array() failure
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 18:09:52 2015 +0100| [7efabffc2899b76688a40b4bd7c63370eb2d8ca8] | committer: Michael Niedermayer ffmpeg_opt: Check for av_realloc_array() failure Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7efabffc2899b76688a40b4bd7c63370eb2d8ca8 --- ffmpeg_opt.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 7594b34..dcd751d 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -1381,10 +1381,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in av_log(NULL, AV_LOG_FATAL, "error parsing rc_override\n"); exit_program(1); } -/* FIXME realloc failure */ video_enc->rc_override = av_realloc_array(video_enc->rc_override, i + 1, sizeof(RcOverride)); +if (!video_enc->rc_override) +exit_program(1); video_enc->rc_override[i].start_frame = start; video_enc->rc_override[i].end_frame = end; if (q > 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/parser: add fuzzy mode to ff_fetch_timestamp()
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 11:52:08 2015 +0100| [69ee915e1c628fdf8b270de8c19ff357333e354a] | committer: Michael Niedermayer avcodec/parser: add fuzzy mode to ff_fetch_timestamp() This will be needed for the following timestamp fix Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69ee915e1c628fdf8b270de8c19ff357333e354a --- libavcodec/mpeg12.c |2 +- libavcodec/parser.c | 24 ++-- libavcodec/parser.h |3 ++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index fc43a53..153e4aa 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -234,7 +234,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, } } if (pc->frame_start_found == 0 && s && state == PICTURE_START_CODE) { -ff_fetch_timestamp(s, i - 3, 1); +ff_fetch_timestamp(s, i - 3, 1, 0); } } } diff --git a/libavcodec/parser.c b/libavcodec/parser.c index d1e1574..8a3be29 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -93,14 +93,16 @@ err_out: return NULL; } -void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove) +void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove, int fuzzy) { int i; -s->dts= -s->pts= AV_NOPTS_VALUE; -s->pos= -1; -s->offset = 0; +if (!fuzzy) { +s->dts= +s->pts= AV_NOPTS_VALUE; +s->pos= -1; +s->offset = 0; +} for (i = 0; i < AV_PARSER_PTS_NB; i++) { if (s->cur_offset + off >= s->cur_frame_offset[i] && (s->frame_offset < s->cur_frame_offset[i] || @@ -108,10 +110,12 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove) // check disabled since MPEG-TS does not send complete PES packets /*s->next_frame_offset + off <*/ s->cur_frame_end[i]){ -s->dts= s->cur_frame_dts[i]; -s->pts= s->cur_frame_pts[i]; -s->pos= s->cur_frame_pos[i]; -s->offset = s->next_frame_offset - s->cur_frame_offset[i]; +if (!fuzzy || s->cur_frame_dts[i] != AV_NOPTS_VALUE) { +s->dts= s->cur_frame_dts[i]; +s->pts= s->cur_frame_pts[i]; +s->pos= s->cur_frame_pos[i]; +s->offset = s->next_frame_offset - s->cur_frame_offset[i]; +} if (remove) s->cur_frame_offset[i] = INT64_MAX; if (s->cur_offset + off < s->cur_frame_end[i]) @@ -154,7 +158,7 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, s->last_pts= s->pts; s->last_dts= s->dts; s->last_pos= s->pos; -ff_fetch_timestamp(s, 0, 0); +ff_fetch_timestamp(s, 0, 0, 0); } /* WARNING: the returned index can be negative */ index = s->parser->parser_parse(s, avctx, (const uint8_t **) poutbuf, diff --git a/libavcodec/parser.h b/libavcodec/parser.h index 7fe0e11..ef35547 100644 --- a/libavcodec/parser.h +++ b/libavcodec/parser.h @@ -53,7 +53,8 @@ void ff_parse_close(AVCodecParserContext *s); * Fetch timestamps for a specific byte within the current access unit. * @param off byte position within the access unit * @param remove Found timestamps will be removed if set to 1, kept if set to 0. + * @param fuzzy Only use found value if it is more informative than what we already have */ -void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove); +void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove, int fuzzy); #endif /* AVCODEC_PARSER_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpeg12: Try to fetch pts/ dts from both the packet associated with the picture start code as well as earlier start codes
ffmpeg | branch: master | Michael Niedermayer | Wed Jan 7 12:18:40 2015 +0100| [ad465e789721194a6bc08a0b02dbbd9b19960f41] | committer: Michael Niedermayer avcodec/mpeg12: Try to fetch pts/dts from both the packet associated with the picture start code as well as earlier start codes Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad465e789721194a6bc08a0b02dbbd9b19960f41 --- libavcodec/mpeg12.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 153e4aa..3128e8d 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -234,7 +234,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, } } if (pc->frame_start_found == 0 && s && state == PICTURE_START_CODE) { -ff_fetch_timestamp(s, i - 3, 1, 0); +ff_fetch_timestamp(s, i - 3, 1, i > 3); } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog