[SCM] ffmpeg/master: Add patches to fix autopkgtest failures and spelling errors
aca-guest at users.alioth.debian.org
aca-guest at users.alioth.debian.org
Sun Oct 30 11:31:28 UTC 2016
The following commit has been merged in the master branch:
commit 04515349f789e014ef0396f7eb9808e5e193306e
Author: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
Date: Sat Oct 29 21:54:28 2016 +0200
Add patches to fix autopkgtest failures and spelling errors
diff --git a/debian/patches/Revert-avformat-hls-Fix-missing-streams-in-some-case.patch b/debian/patches/Revert-avformat-hls-Fix-missing-streams-in-some-case.patch
new file mode 100644
index 0000000..b33574f
--- /dev/null
+++ b/debian/patches/Revert-avformat-hls-Fix-missing-streams-in-some-case.patch
@@ -0,0 +1,109 @@
+From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+Date: Sat, 29 Oct 2016 21:29:45 +0200
+Subject: Revert "avformat/hls: Fix missing streams in some cases with MPEG TS"
+
+It broke probing dts/eac3/mp2 in hls.
+
+This reverts commit 04964ac311abe670fb3b60290a330f2067544b13.
+---
+ libavformat/hls.c | 56 +++++--------------------------------------------------
+ 1 file changed, 5 insertions(+), 51 deletions(-)
+
+diff --git a/libavformat/hls.c b/libavformat/hls.c
+index 3c09dd8..b627598 100644
+--- a/libavformat/hls.c
++++ b/libavformat/hls.c
+@@ -98,7 +98,6 @@ struct playlist {
+ int index;
+ AVFormatContext *ctx;
+ AVPacket pkt;
+- int has_noheader_flag;
+
+ /* main demuxer streams associated with this playlist
+ * indexed by the subdemuxer stream indexes */
+@@ -1556,27 +1555,6 @@ static int update_streams_from_subdemuxer(AVFormatContext *s, struct playlist *p
+ return 0;
+ }
+
+-static void update_noheader_flag(AVFormatContext *s)
+-{
+- HLSContext *c = s->priv_data;
+- int flag_needed = 0;
+- int i;
+-
+- for (i = 0; i < c->n_playlists; i++) {
+- struct playlist *pls = c->playlists[i];
+-
+- if (pls->has_noheader_flag) {
+- flag_needed = 1;
+- break;
+- }
+- }
+-
+- if (flag_needed)
+- s->ctx_flags |= AVFMTCTX_NOHEADER;
+- else
+- s->ctx_flags &= ~AVFMTCTX_NOHEADER;
+-}
+-
+ static int hls_read_header(AVFormatContext *s)
+ {
+ void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb;
+@@ -1747,23 +1725,14 @@ static int hls_read_header(AVFormatContext *s)
+ pls->id3_deferred_extra = NULL;
+ }
+
++ pls->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
++ ret = avformat_find_stream_info(pls->ctx, NULL);
++ if (ret < 0)
++ goto fail;
++
+ if (pls->is_id3_timestamped == -1)
+ av_log(s, AV_LOG_WARNING, "No expected HTTP requests have been made\n");
+
+- /*
+- * For ID3 timestamped raw audio streams we need to detect the packet
+- * durations to calculate timestamps in fill_timing_for_id3_timestamped_stream(),
+- * but for other streams we can rely on our user calling avformat_find_stream_info()
+- * on us if they want to.
+- */
+- if (pls->is_id3_timestamped) {
+- ret = avformat_find_stream_info(pls->ctx, NULL);
+- if (ret < 0)
+- goto fail;
+- }
+-
+- pls->has_noheader_flag = !!(pls->ctx->ctx_flags & AVFMTCTX_NOHEADER);
+-
+ /* Create new AVStreams for each stream in this playlist */
+ ret = update_streams_from_subdemuxer(s, pls);
+ if (ret < 0)
+@@ -1774,8 +1743,6 @@ static int hls_read_header(AVFormatContext *s)
+ add_metadata_from_renditions(s, pls, AVMEDIA_TYPE_SUBTITLE);
+ }
+
+- update_noheader_flag(s);
+-
+ return 0;
+ fail:
+ free_playlist_list(c);
+@@ -1947,19 +1914,6 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
+ if (minplaylist >= 0) {
+ struct playlist *pls = c->playlists[minplaylist];
+
+- ret = update_streams_from_subdemuxer(s, pls);
+- if (ret < 0) {
+- av_packet_unref(&pls->pkt);
+- reset_packet(&pls->pkt);
+- return ret;
+- }
+-
+- /* check if noheader flag has been cleared by the subdemuxer */
+- if (pls->has_noheader_flag && !(pls->ctx->ctx_flags & AVFMTCTX_NOHEADER)) {
+- pls->has_noheader_flag = 0;
+- update_noheader_flag(s);
+- }
+-
+ if (pls->pkt.stream_index >= pls->n_main_streams) {
+ av_log(s, AV_LOG_ERROR, "stream index inconsistency: index %d, %d main streams, %d subdemuxer streams\n",
+ pls->pkt.stream_index, pls->n_main_streams, pls->ctx->nb_streams);
diff --git a/debian/patches/apng-use-side-data-to-pass-extradata-to-muxer.patch b/debian/patches/apng-use-side-data-to-pass-extradata-to-muxer.patch
new file mode 100644
index 0000000..acaee7f
--- /dev/null
+++ b/debian/patches/apng-use-side-data-to-pass-extradata-to-muxer.patch
@@ -0,0 +1,194 @@
+From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+Date: Thu, 27 Oct 2016 22:34:48 +0200
+Subject: apng: use side data to pass extradata to muxer
+
+This fixes creating apng files, which is broken since commit
+5ef19590802f000299e418143fc2301e3f43affe.
+
+Reviewed-by: James Almer <jamrial at gmail.com>
+Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+---
+ libavcodec/pngenc.c | 18 +++++++++++++++---
+ libavformat/apngenc.c | 45 +++++++++++++++++++++++++++++++++++----------
+ 2 files changed, 50 insertions(+), 13 deletions(-)
+
+diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
+index 00c830e..51ae094 100644
+--- a/libavcodec/pngenc.c
++++ b/libavcodec/pngenc.c
+@@ -68,6 +68,9 @@ typedef struct PNGEncContext {
+ // APNG
+ uint32_t palette_checksum; // Used to ensure a single unique palette
+ uint32_t sequence_number;
++ int extra_data_updated;
++ uint8_t *extra_data;
++ int extra_data_size;
+
+ AVFrame *prev_frame;
+ AVFrame *last_frame;
+@@ -870,15 +873,15 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
+ if (!pict)
+ return AVERROR(EINVAL);
+
+- s->bytestream = avctx->extradata = av_malloc(FF_MIN_BUFFER_SIZE);
+- if (!avctx->extradata)
++ s->bytestream = s->extra_data = av_malloc(FF_MIN_BUFFER_SIZE);
++ if (!s->extra_data)
+ return AVERROR(ENOMEM);
+
+ ret = encode_headers(avctx, pict);
+ if (ret < 0)
+ return ret;
+
+- avctx->extradata_size = s->bytestream - avctx->extradata;
++ s->extra_data_size = s->bytestream - s->extra_data;
+
+ s->last_frame_packet = av_malloc(max_packet_size);
+ if (!s->last_frame_packet)
+@@ -917,6 +920,13 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
+ if (s->last_frame) {
+ uint8_t* last_fctl_chunk_start = pkt->data;
+ uint8_t buf[26];
++ if (!s->extra_data_updated) {
++ uint8_t *side_data = av_packet_new_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, s->extra_data_size);
++ if (!side_data)
++ return AVERROR(ENOMEM);
++ memcpy(side_data, s->extra_data, s->extra_data_size);
++ s->extra_data_updated = 1;
++ }
+
+ AV_WB32(buf + 0, s->last_frame_fctl.sequence_number);
+ AV_WB32(buf + 4, s->last_frame_fctl.width);
+@@ -1093,6 +1103,8 @@ static av_cold int png_enc_close(AVCodecContext *avctx)
+ av_frame_free(&s->last_frame);
+ av_frame_free(&s->prev_frame);
+ av_freep(&s->last_frame_packet);
++ av_freep(&s->extra_data);
++ s->extra_data_size = 0;
+ return 0;
+ }
+
+diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c
+index e25df2e..e5e8aa9 100644
+--- a/libavformat/apngenc.c
++++ b/libavformat/apngenc.c
+@@ -44,6 +44,9 @@ typedef struct APNGMuxContext {
+ AVRational prev_delay;
+
+ int framerate_warned;
++
++ uint8_t *extra_data;
++ int extra_data_size;
+ } APNGMuxContext;
+
+ static uint8_t *apng_find_chunk(uint32_t tag, uint8_t *buf, size_t length)
+@@ -101,15 +104,27 @@ static int apng_write_header(AVFormatContext *format_context)
+ return 0;
+ }
+
+-static void flush_packet(AVFormatContext *format_context, AVPacket *packet)
++static int flush_packet(AVFormatContext *format_context, AVPacket *packet)
+ {
+ APNGMuxContext *apng = format_context->priv_data;
+ AVIOContext *io_context = format_context->pb;
+ AVStream *codec_stream = format_context->streams[0];
+- AVCodecParameters *codec_par = codec_stream->codecpar;
++ uint8_t *side_data = NULL;
++ int side_data_size = 0;
+
+ av_assert0(apng->prev_packet);
+
++ side_data = av_packet_get_side_data(apng->prev_packet, AV_PKT_DATA_NEW_EXTRADATA, &side_data_size);
++
++ if (side_data_size) {
++ av_freep(&apng->extra_data);
++ apng->extra_data = av_mallocz(side_data_size + AV_INPUT_BUFFER_PADDING_SIZE);
++ if (!apng->extra_data)
++ return AVERROR(ENOMEM);
++ apng->extra_data_size = side_data_size;
++ memcpy(apng->extra_data, side_data, apng->extra_data_size);
++ }
++
+ if (apng->frame_number == 0 && !packet) {
+ uint8_t *existing_acTL_chunk;
+ uint8_t *existing_fcTL_chunk;
+@@ -117,13 +132,13 @@ static void flush_packet(AVFormatContext *format_context, AVPacket *packet)
+ av_log(format_context, AV_LOG_INFO, "Only a single frame so saving as a normal PNG.\n");
+
+ // Write normal PNG headers without acTL chunk
+- existing_acTL_chunk = apng_find_chunk(MKBETAG('a', 'c', 'T', 'L'), codec_par->extradata, codec_par->extradata_size);
++ existing_acTL_chunk = apng_find_chunk(MKBETAG('a', 'c', 'T', 'L'), apng->extra_data, apng->extra_data_size);
+ if (existing_acTL_chunk) {
+ uint8_t *chunk_after_acTL = existing_acTL_chunk + AV_RB32(existing_acTL_chunk) + 12;
+- avio_write(io_context, codec_par->extradata, existing_acTL_chunk - codec_par->extradata);
+- avio_write(io_context, chunk_after_acTL, codec_par->extradata + codec_par->extradata_size - chunk_after_acTL);
++ avio_write(io_context, apng->extra_data, existing_acTL_chunk - apng->extra_data);
++ avio_write(io_context, chunk_after_acTL, apng->extra_data + apng->extra_data_size - chunk_after_acTL);
+ } else {
+- avio_write(io_context, codec_par->extradata, codec_par->extradata_size);
++ avio_write(io_context, apng->extra_data, apng->extra_data_size);
+ }
+
+ // Write frame data without fcTL chunk
+@@ -142,9 +157,9 @@ static void flush_packet(AVFormatContext *format_context, AVPacket *packet)
+ uint8_t *existing_acTL_chunk;
+
+ // Write normal PNG headers
+- avio_write(io_context, codec_par->extradata, codec_par->extradata_size);
++ avio_write(io_context, apng->extra_data, apng->extra_data_size);
+
+- existing_acTL_chunk = apng_find_chunk(MKBETAG('a', 'c', 'T', 'L'), codec_par->extradata, codec_par->extradata_size);
++ existing_acTL_chunk = apng_find_chunk(MKBETAG('a', 'c', 'T', 'L'), apng->extra_data, apng->extra_data_size);
+ if (!existing_acTL_chunk) {
+ uint8_t buf[8];
+ // Write animation control header
+@@ -195,11 +210,13 @@ static void flush_packet(AVFormatContext *format_context, AVPacket *packet)
+ av_packet_unref(apng->prev_packet);
+ if (packet)
+ av_copy_packet(apng->prev_packet, packet);
++ return 0;
+ }
+
+ static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet)
+ {
+ APNGMuxContext *apng = format_context->priv_data;
++ int ret;
+
+ if (!apng->prev_packet) {
+ apng->prev_packet = av_malloc(sizeof(*apng->prev_packet));
+@@ -208,7 +225,9 @@ static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet)
+
+ av_copy_packet(apng->prev_packet, packet);
+ } else {
+- flush_packet(format_context, packet);
++ ret = flush_packet(format_context, packet);
++ if (ret < 0)
++ return ret;
+ }
+
+ return 0;
+@@ -219,10 +238,13 @@ static int apng_write_trailer(AVFormatContext *format_context)
+ APNGMuxContext *apng = format_context->priv_data;
+ AVIOContext *io_context = format_context->pb;
+ uint8_t buf[8];
++ int ret;
+
+ if (apng->prev_packet) {
+- flush_packet(format_context, NULL);
++ ret = flush_packet(format_context, NULL);
+ av_freep(&apng->prev_packet);
++ if (ret < 0)
++ return ret;
+ }
+
+ apng_write_chunk(io_context, MKBETAG('I', 'E', 'N', 'D'), NULL, 0);
+@@ -235,6 +257,9 @@ static int apng_write_trailer(AVFormatContext *format_context)
+ apng_write_chunk(io_context, MKBETAG('a', 'c', 'T', 'L'), buf, 8);
+ }
+
++ av_freep(&apng->extra_data);
++ apng->extra_data = 0;
++
+ return 0;
+ }
+
diff --git a/debian/patches/doc-fix-spelling-errors.patch b/debian/patches/doc-fix-spelling-errors.patch
new file mode 100644
index 0000000..56b3af5
--- /dev/null
+++ b/debian/patches/doc-fix-spelling-errors.patch
@@ -0,0 +1,51 @@
+From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+Date: Sat, 29 Oct 2016 16:55:14 +0200
+Subject: doc: fix spelling errors
+
+Reviewed-by: Lou Logan <lou at lrcd.com>
+Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+---
+ doc/filters.texi | 2 +-
+ doc/formats.texi | 2 +-
+ libavcodec/4xm.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/doc/filters.texi b/doc/filters.texi
+index c37fa29..1ebf251 100644
+--- a/doc/filters.texi
++++ b/doc/filters.texi
+@@ -9665,7 +9665,7 @@ Scene change detection method. Scene change leads motion vectors to be in random
+ @item none
+ Disable scene change detection.
+ @item fdiff
+-Frame difference. Corresponding pixel values are compared and if it statisfies @var{scd_threshold} scene change is detected.
++Frame difference. Corresponding pixel values are compared and if it satisfies @var{scd_threshold} scene change is detected.
+ @end table
+ Default method is @samp{fdiff}.
+
+diff --git a/doc/formats.texi b/doc/formats.texi
+index 5ef7fad..87704af 100644
+--- a/doc/formats.texi
++++ b/doc/formats.texi
+@@ -63,7 +63,7 @@ This ensures that file and data checksums are reproducible and match between
+ platforms. Its primary use is for regression testing.
+ @item shortest
+ Stop muxing at the end of the shortest stream.
+-It may be needed to increase max_interleave_delta to avoid flusing the longer
++It may be needed to increase max_interleave_delta to avoid flushing the longer
+ streams before EOF.
+ @end table
+
+diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
+index a7a757a..5547dfd 100644
+--- a/libavcodec/4xm.c
++++ b/libavcodec/4xm.c
+@@ -532,7 +532,7 @@ static int decode_i_block(FourXContext *f, int16_t *block)
+ }
+ i += code >> 4;
+ if (i >= 64) {
+- av_log(f->avctx, AV_LOG_ERROR, "run %d oveflow\n", i);
++ av_log(f->avctx, AV_LOG_ERROR, "run %d overflow\n", i);
+ return 0;
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..68be241
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+apng-use-side-data-to-pass-extradata-to-muxer.patch
+Revert-avformat-hls-Fix-missing-streams-in-some-case.patch
+doc-fix-spelling-errors.patch
--
ffmpeg packaging
More information about the pkg-multimedia-commits
mailing list