[FFmpeg-cvslog] h264: discard slices of redundant pictures right after parsing the slice header

2016-08-04 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri May 20 
12:30:42 2016 +0200| [e26c64148be8a20ace7512d96503172fb5e9753b] | committer: 
Anton Khirnov

h264: discard slices of redundant pictures right after parsing the slice header

Going through the whole decoder initialization process for a slice we
are not going to decode is unnecessary and potentially dangerous.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e26c64148be8a20ace7512d96503172fb5e9753b
---

 libavcodec/h264_slice.c | 4 
 libavcodec/h264dec.c| 6 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index dbff1f3..4910396 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1565,6 +1565,10 @@ int ff_h264_decode_slice_header(H264Context *h, 
H264SliceContext *sl,
 if (ret < 0)
 return ret;
 
+// discard redundant pictures
+if (sl->redundant_pic_count > 0)
+return 0;
+
 if (!h->setup_finished) {
 if (sl->first_mb_addr == 0) { // FIXME better field boundary detection
 if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index b98d141..38ecc94 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -701,6 +701,9 @@ static int decode_nal_units(H264Context *h, const uint8_t 
*buf, int buf_size)
 if ((err = ff_h264_decode_slice_header(h, sl, nal)))
 break;
 
+if (sl->redundant_pic_count > 0)
+break;
+
 if (h->sei.recovery_point.recovery_frame_cnt >= 0 && 
h->recovery_frame < 0) {
 h->recovery_frame = (h->poc.frame_num + 
h->sei.recovery_point.recovery_frame_cnt) &
 ((1 << h->ps.sps->log2_max_frame_num) - 1);
@@ -724,8 +727,7 @@ static int decode_nal_units(H264Context *h, const uint8_t 
*buf, int buf_size)
 decode_postinit(h, i >= nals_needed);
 }
 
-if (sl->redundant_pic_count == 0 &&
-(avctx->skip_frame < AVDISCARD_NONREF || nal->ref_idc) &&
+if ((avctx->skip_frame < AVDISCARD_NONREF || nal->ref_idc) &&
 (avctx->skip_frame < AVDISCARD_BIDIR  ||
  sl->slice_type_nos != AV_PICTURE_TYPE_B) &&
 (avctx->skip_frame < AVDISCARD_NONKEY ||

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] h264dec: Fix indentation

2016-08-04 Thread Timothy Gu
ffmpeg | branch: master | Timothy Gu  | Thu Aug  4 
11:16:44 2016 -0700| [f297d1e9e5281e4ed9c0e21b181ba2d0a7735e67] | committer: 
Timothy Gu

h264dec: Fix indentation

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f297d1e9e5281e4ed9c0e21b181ba2d0a7735e67
---

 libavcodec/h264dec.c | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 9313301..904ae55 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -816,24 +816,24 @@ again:
 #endif
 }
 
-if (avctx->hwaccel) {
-ret = avctx->hwaccel->decode_slice(avctx,
-   nal->raw_data,
-   nal->raw_size);
-if (ret < 0)
-goto end;
+if (avctx->hwaccel) {
+ret = avctx->hwaccel->decode_slice(avctx,
+   nal->raw_data,
+   nal->raw_size);
+if (ret < 0)
+goto end;
 #if FF_API_CAP_VDPAU
-} else if (CONFIG_H264_VDPAU_DECODER &&
-   h->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU) {
-ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
-start_code,
-sizeof(start_code));
-ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
-nal->raw_data,
-nal->raw_size);
+} else if (CONFIG_H264_VDPAU_DECODER &&
+   h->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU) {
+ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
+start_code,
+sizeof(start_code));
+ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
+nal->raw_data,
+nal->raw_size);
 #endif
-} else
-context_count++;
+} else
+context_count++;
 break;
 case H264_NAL_DPA:
 case H264_NAL_DPB:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: add a function for determining whether a filtergraph is simple

2016-08-04 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun May 22 
17:57:59 2016 +0200| [49670e4218d34899a1c37abb7a11615efc16f757] | committer: 
Anton Khirnov

avconv: add a function for determining whether a filtergraph is simple

This makes the code easier to read.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49670e4218d34899a1c37abb7a11615efc16f757
---

 avconv.c| 4 ++--
 avconv.h| 1 +
 avconv_filter.c | 6 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/avconv.c b/avconv.c
index 2e3bde9..8cb8d14 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2123,7 +2123,7 @@ static int transcode_init(void)
 ist = input_streams[i];
 
 for (j = 0; j < ist->nb_filters; j++) {
-if (ist->filters[j]->graph->graph_desc) {
+if (!filtergraph_is_simple(ist->filters[j]->graph)) {
 av_log(NULL, AV_LOG_INFO, "  Stream #%d:%d (%s) -> %s",
ist->file_index, ist->st->index, ist->dec ? 
ist->dec->name : "?",
ist->filters[j]->name);
@@ -2144,7 +2144,7 @@ static int transcode_init(void)
 continue;
 }
 
-if (ost->filter && ost->filter->graph->graph_desc) {
+if (ost->filter && !filtergraph_is_simple(ost->filter->graph)) {
 /* output from a complex graph */
 av_log(NULL, AV_LOG_INFO, "  %s", ost->filter->name);
 if (nb_filtergraphs > 1)
diff --git a/avconv.h b/avconv.h
index 84fabf6..be8ef23 100644
--- a/avconv.h
+++ b/avconv.h
@@ -449,6 +449,7 @@ int guess_input_channel_layout(InputStream *ist);
 int configure_filtergraph(FilterGraph *fg);
 int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, 
AVFilterInOut *out);
 int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
+int filtergraph_is_simple(FilterGraph *fg);
 FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
 int init_complex_filtergraph(FilterGraph *fg);
 
diff --git a/avconv_filter.c b/avconv_filter.c
index a412f6e..1d4aeb0 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -691,7 +691,7 @@ static int configure_input_filter(FilterGraph *fg, 
InputFilter *ifilter,
 int configure_filtergraph(FilterGraph *fg)
 {
 AVFilterInOut *inputs, *outputs, *cur;
-int ret, i, simple = !fg->graph_desc;
+int ret, i, simple = filtergraph_is_simple(fg);
 const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
   fg->graph_desc;
 
@@ -760,3 +760,7 @@ int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
 return 0;
 }
 
+int filtergraph_is_simple(FilterGraph *fg)
+{
+return !fg->graph_desc;
+}

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] h264: handle frame recovery in h264_field_start()

2016-08-04 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri May 20 
12:42:23 2016 +0200| [58640fe89ec4f2a3d67c0a2585fca8de34440857] | committer: 
Anton Khirnov

h264: handle frame recovery in h264_field_start()

This is a more appropriate place for this. H264Context.recovery_frame is
shared between frame threads, so modifying it where it is right now is
invalid.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58640fe89ec4f2a3d67c0a2585fca8de34440857
---

 libavcodec/h264_slice.c | 18 ++
 libavcodec/h264dec.c| 18 --
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 4910396..2b7e088 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1335,6 +1335,24 @@ static int h264_field_start(H264Context *h, const 
H264SliceContext *sl,
 
 h->picture_idr = nal->type == H264_NAL_IDR_SLICE;
 
+if (h->sei.recovery_point.recovery_frame_cnt >= 0 && h->recovery_frame < 
0) {
+h->recovery_frame = (h->poc.frame_num + 
h->sei.recovery_point.recovery_frame_cnt) &
+((1 << h->ps.sps->log2_max_frame_num) - 1);
+}
+
+h->cur_pic_ptr->f->key_frame |= (nal->type == H264_NAL_IDR_SLICE) ||
+(h->sei.recovery_point.recovery_frame_cnt 
>= 0);
+
+if (nal->type == H264_NAL_IDR_SLICE || h->recovery_frame == 
h->poc.frame_num) {
+h->recovery_frame = -1;
+h->cur_pic_ptr->recovered = 1;
+}
+// If we have an IDR, all frames after it in decoded order are
+// "recovered".
+if (nal->type == H264_NAL_IDR_SLICE)
+h->frame_recovered |= FRAME_RECOVERED_IDR;
+h->cur_pic_ptr->recovered |= !!(h->frame_recovered & FRAME_RECOVERED_IDR);
+
 /* Set the frame properties/side data. Only done for the second field in
  * field coded frames, since some SEI information is present for each field
  * and is merged by the SEI parsing code. */
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 38ecc94..a148825 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -704,24 +704,6 @@ static int decode_nal_units(H264Context *h, const uint8_t 
*buf, int buf_size)
 if (sl->redundant_pic_count > 0)
 break;
 
-if (h->sei.recovery_point.recovery_frame_cnt >= 0 && 
h->recovery_frame < 0) {
-h->recovery_frame = (h->poc.frame_num + 
h->sei.recovery_point.recovery_frame_cnt) &
-((1 << h->ps.sps->log2_max_frame_num) - 1);
-}
-
-h->cur_pic_ptr->f->key_frame |=
-(nal->type == H264_NAL_IDR_SLICE) || 
(h->sei.recovery_point.recovery_frame_cnt >= 0);
-
-if (nal->type == H264_NAL_IDR_SLICE || h->recovery_frame == 
h->poc.frame_num) {
-h->recovery_frame = -1;
-h->cur_pic_ptr->recovered = 1;
-}
-// If we have an IDR, all frames after it in decoded order are
-// "recovered".
-if (nal->type == H264_NAL_IDR_SLICE)
-h->frame_recovered |= FRAME_RECOVERED_IDR;
-h->cur_pic_ptr->recovered |= !!(h->frame_recovered & 
FRAME_RECOVERED_IDR);
-
 if (h->current_slice == 1) {
 if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS))
 decode_postinit(h, i >= nals_needed);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffmpeg_opt: Remove duplicated initialization of attachment stream

2016-08-04 Thread Timothy Gu
ffmpeg | branch: master | Timothy Gu  | Wed Aug  3 
21:29:38 2016 -0700| [26648703dbfb7b6b9ee70d4a58d2bcc079c33038] | committer: 
Timothy Gu

ffmpeg_opt: Remove duplicated initialization of attachment stream

These two fields are already initialized to the same values in
new_attachment_stream().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=26648703dbfb7b6b9ee70d4a58d2bcc079c33038
---

 ffmpeg_opt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index d995b52..10e66c2 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2220,9 +2220,7 @@ loop_end:
 avio_read(pb, attachment, len);
 
 ost = new_attachment_stream(o, oc, -1);
-ost->stream_copy   = 1;
 ost->attachment_filename   = o->attachments[i];
-ost->finished  = 1;
 ost->st->codec->extradata  = attachment;
 ost->st->codec->extradata_size = len;
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'e26c64148be8a20ace7512d96503172fb5e9753b'

2016-08-04 Thread Timothy Gu
ffmpeg | branch: master | Timothy Gu  | Wed Aug  3 
19:46:06 2016 -0700| [de625312862a99500ce7aa1703b5d783ae66d704] | committer: 
Timothy Gu

Merge commit 'e26c64148be8a20ace7512d96503172fb5e9753b'

* commit 'e26c64148be8a20ace7512d96503172fb5e9753b':
  h264: discard slices of redundant pictures right after parsing the slice 
header

Conflicts:
libavcodec/h264_slice.c
libavcodec/h264dec.c

TODO: fix indentation

Merged-by: Timothy Gu 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de625312862a99500ce7aa1703b5d783ae66d704
---

 libavcodec/h264_slice.c | 4 
 libavcodec/h264dec.c| 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c2490cb..c6f40e5 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1738,6 +1738,10 @@ int ff_h264_decode_slice_header(H264Context *h, 
H264SliceContext *sl,
 if (ret < 0)
 return ret;
 
+// discard redundant pictures
+if (sl->redundant_pic_count > 0)
+return 0;
+
 if (sl->first_mb_addr == 0 || !h->current_slice) {
 if (h->setup_finished) {
 av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 9779774..c72a7fc 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -799,6 +799,9 @@ again:
 if ((err = ff_h264_decode_slice_header(h, sl, nal)))
 break;
 
+if (sl->redundant_pic_count > 0)
+break;
+
 if (h->sei.recovery_point.recovery_frame_cnt >= 0) {
 const int sei_recovery_frame_cnt = 
h->sei.recovery_point.recovery_frame_cnt;
 
@@ -845,7 +848,6 @@ again:
 #endif
 }
 
-if (sl->redundant_pic_count == 0) {
 if (avctx->hwaccel) {
 ret = avctx->hwaccel->decode_slice(avctx,
nal->raw_data,
@@ -864,7 +866,6 @@ again:
 #endif
 } else
 context_count++;
-}
 break;
 case H264_NAL_DPA:
 case H264_NAL_DPB:


==

diff --cc libavcodec/h264_slice.c
index c2490cb,4910396..c6f40e5
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@@ -1738,62 -1565,30 +1738,66 @@@ int ff_h264_decode_slice_header(H264Con
  if (ret < 0)
  return ret;
  
+ // discard redundant pictures
+ if (sl->redundant_pic_count > 0)
+ return 0;
+ 
 -if (!h->setup_finished) {
 -if (sl->first_mb_addr == 0) { // FIXME better field boundary detection
 -if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
 -ff_h264_field_end(h, sl, 1);
 -}
 +if (sl->first_mb_addr == 0 || !h->current_slice) {
 +if (h->setup_finished) {
 +av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
 +return AVERROR_INVALIDDATA;
 +}
 +}
  
 -h->current_slice = 0;
 -if (!h->first_field) {
 -if (h->cur_pic_ptr && !h->droppable) {
 -ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
 -  h->picture_structure == 
PICT_BOTTOM_FIELD);
 +if (sl->first_mb_addr == 0) { // FIXME better field boundary detection
 +if (h->current_slice) {
 +if (h->max_contexts > 1) {
 +if (!h->single_decode_warning) {
 +av_log(h->avctx, AV_LOG_WARNING, "Cannot decode multiple 
access units as slice threads\n");
 +h->single_decode_warning = 1;
  }
 +h->max_contexts = 1;
 +return SLICE_SINGLETHREAD;
 +}
 +
 +if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
 +ret = ff_h264_field_end(h, h->slice_ctx, 1);
 +h->current_slice = 0;
 +if (ret < 0)
 +return ret;
 +} else if (h->cur_pic_ptr && !FIELD_PICTURE(h) && !h->first_field 
&& h->nal_unit_type  == H264_NAL_IDR_SLICE) {
 +av_log(h, AV_LOG_WARNING, "Broken frame packetizing\n");
 +ret = ff_h264_field_end(h, h->slice_ctx, 1);
 +h->current_slice = 0;
 +ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0);
 +ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1);
  h->cur_pic_ptr = NULL;
 +if (ret < 0)
 +return ret;
 +} else
 +return AVERROR_INVALIDDATA;
 +}
 +
 +if (!h->first_field) {
 +if (h->cur_pic_ptr && !h->droppable) {
 +ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
 +  h->picture_structure == 
PICT_BOTTOM_FIEL

[FFmpeg-cvslog] avconv: create simple filtergraphs earlier

2016-08-04 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun May 22 
19:57:36 2016 +0200| [73c6ec6d659bab11ac424a4ba6ce3a56246295ee] | committer: 
Anton Khirnov

avconv: create simple filtergraphs earlier

We already have all the necessary information in open_output_file().
This makes the information about the stream/filtergraph mappings
available earlier.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=73c6ec6d659bab11ac424a4ba6ce3a56246295ee
---

 avconv.c|  9 -
 avconv.h|  2 +-
 avconv_filter.c |  4 ++--
 avconv_opt.c| 16 ++--
 4 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/avconv.c b/avconv.c
index 8cb8d14..e5a76b1 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2008,11 +2008,10 @@ static int transcode_init(void)
 exit_program(1);
 #endif
 
-if (!ost->filter &&
-(enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
- enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO)) {
-FilterGraph *fg;
-fg = init_simple_filtergraph(ist, ost);
+if ((enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
+ enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO) &&
+ filtergraph_is_simple(ost->filter->graph)) {
+FilterGraph *fg = ost->filter->graph;
 if (configure_filtergraph(fg)) {
 av_log(NULL, AV_LOG_FATAL, "Error opening filters!\n");
 exit_program(1);
diff --git a/avconv.h b/avconv.h
index be8ef23..78dbbdd 100644
--- a/avconv.h
+++ b/avconv.h
@@ -450,7 +450,7 @@ int configure_filtergraph(FilterGraph *fg);
 int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, 
AVFilterInOut *out);
 int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
 int filtergraph_is_simple(FilterGraph *fg);
-FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
+int init_simple_filtergraph(InputStream *ist, OutputStream *ost);
 int init_complex_filtergraph(FilterGraph *fg);
 
 int avconv_parse_options(int argc, char **argv);
diff --git a/avconv_filter.c b/avconv_filter.c
index 1d4aeb0..875ce10 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -76,7 +76,7 @@ DEF_CHOOSE_FORMAT(int, sample_rate, supported_samplerates, 0,
 DEF_CHOOSE_FORMAT(uint64_t, channel_layout, channel_layouts, 0,
   GET_CH_LAYOUT_NAME)
 
-FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
+int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
 {
 FilterGraph *fg = av_mallocz(sizeof(*fg));
 
@@ -104,7 +104,7 @@ FilterGraph *init_simple_filtergraph(InputStream *ist, 
OutputStream *ost)
 GROW_ARRAY(filtergraphs, nb_filtergraphs);
 filtergraphs[nb_filtergraphs - 1] = fg;
 
-return fg;
+return 0;
 }
 
 static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
diff --git a/avconv_opt.c b/avconv_opt.c
index b760a18..9e90711 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1469,7 +1469,7 @@ static int configure_complex_filters(void)
 int i, ret = 0;
 
 for (i = 0; i < nb_filtergraphs; i++)
-if (!filtergraphs[i]->graph &&
+if (!filtergraph_is_simple(filtergraphs[i]) &&
 (ret = configure_filtergraph(filtergraphs[i])) < 0)
 return ret;
 return 0;
@@ -1723,7 +1723,7 @@ loop_end:
 }
 av_dict_free(&unused_opts);
 
-/* set the encoding/decoding_needed flags */
+/* set the encoding/decoding_needed flags and create simple filtergraphs */
 for (i = of->ost_index; i < nb_output_streams; i++) {
 OutputStream *ost = output_streams[i];
 
@@ -1731,6 +1731,18 @@ loop_end:
 if (ost->encoding_needed && ost->source_index >= 0) {
 InputStream *ist = input_streams[ost->source_index];
 ist->decoding_needed = 1;
+
+if (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
+ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+err = init_simple_filtergraph(ist, ost);
+if (err < 0) {
+av_log(NULL, AV_LOG_ERROR,
+   "Error initializing a simple filtergraph between 
streams "
+   "%d:%d->%d:%d\n", ist->file_index, 
ost->source_index,
+   nb_output_files - 1, ost->st->index);
+exit_program(1);
+}
+}
 }
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: fix handling attachments in init_output_stream

2016-08-04 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon May 23 
09:59:35 2016 +0200| [5e1840622ce6e41c57d9c407604863d3f3dcc3ae] | committer: 
Anton Khirnov

avconv: fix handling attachments in init_output_stream

The current code assumes that encoding_needed is simply an inverse of
stream_copy, which is not true for manually attached files (for which
neither of those is true).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e1840622ce6e41c57d9c407604863d3f3dcc3ae
---

 avconv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/avconv.c b/avconv.c
index e5a76b1..4f8d688 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1734,7 +1734,7 @@ static int init_output_stream(OutputStream *ost, char 
*error, int error_len)
 }
 
 ost->st->time_base = ost->enc_ctx->time_base;
-} else {
+} else if (ost->stream_copy) {
 ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
 if (ret < 0)
 return ret;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] h264: always set redundant_pic_count during slice header parsing

2016-08-04 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri May 20 
12:33:30 2016 +0200| [6efc4638584e1e14d1a6152186ba28f5d48a80c0] | committer: 
Anton Khirnov

h264: always set redundant_pic_count during slice header parsing

It is always checked in the surrounding code, so this make sure we don't
see a value from an old slice.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6efc4638584e1e14d1a6152186ba28f5d48a80c0
---

 libavcodec/h264_slice.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 53f745e..dbff1f3 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1452,6 +1452,7 @@ static int h264_slice_header_parse(H264SliceContext *sl, 
const H2645NAL *nal,
 sl->delta_poc[1] = get_se_golomb(&sl->gb);
 }
 
+sl->redundant_pic_count = 0;
 if (pps->redundant_pic_cnt_present)
 sl->redundant_pic_count = get_ue_golomb(&sl->gb);
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '6efc4638584e1e14d1a6152186ba28f5d48a80c0'

2016-08-04 Thread Timothy Gu
ffmpeg | branch: master | Timothy Gu  | Wed Aug  3 
19:09:19 2016 -0700| [e0c8250a59adbf7135adb870be275df05a61e052] | committer: 
Timothy Gu

Merge commit '6efc4638584e1e14d1a6152186ba28f5d48a80c0'

* commit '6efc4638584e1e14d1a6152186ba28f5d48a80c0':
  h264: always set redundant_pic_count during slice header parsing

Merged-by: Timothy Gu 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e0c8250a59adbf7135adb870be275df05a61e052
---

 libavcodec/h264_slice.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index ade41f5..c2490cb 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1624,6 +1624,7 @@ static int h264_slice_header_parse(const H264Context *h, 
H264SliceContext *sl,
 sl->delta_poc[1] = get_se_golomb(&sl->gb);
 }
 
+sl->redundant_pic_count = 0;
 if (pps->redundant_pic_cnt_present)
 sl->redundant_pic_count = get_ue_golomb(&sl->gb);
 


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '58640fe89ec4f2a3d67c0a2585fca8de34440857'

2016-08-04 Thread Timothy Gu
ffmpeg | branch: master | Timothy Gu  | Wed Aug  3 
20:07:21 2016 -0700| [7f7cedd7139f18480e3dacd1abcfd94bda01fa17] | committer: 
Timothy Gu

Merge commit '58640fe89ec4f2a3d67c0a2585fca8de34440857'

* commit '58640fe89ec4f2a3d67c0a2585fca8de34440857':
  h264: handle frame recovery in h264_field_start()

Conflicts:
libavcodec/h264dec.c

Merged-by: Timothy Gu 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f7cedd7139f18480e3dacd1abcfd94bda01fa17
---

 libavcodec/h264_slice.c | 32 
 libavcodec/h264dec.c| 32 
 2 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c6f40e5..25a5890 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1499,6 +1499,38 @@ static int h264_field_start(H264Context *h, const 
H264SliceContext *sl,
 
 h->picture_idr = nal->type == H264_NAL_IDR_SLICE;
 
+if (h->sei.recovery_point.recovery_frame_cnt >= 0) {
+const int sei_recovery_frame_cnt = 
h->sei.recovery_point.recovery_frame_cnt;
+
+if (h->poc.frame_num != sei_recovery_frame_cnt || sl->slice_type_nos 
!= AV_PICTURE_TYPE_I)
+h->valid_recovery_point = 1;
+
+if (   h->recovery_frame < 0
+|| av_mod_uintp2(h->recovery_frame - h->poc.frame_num, 
h->ps.sps->log2_max_frame_num) > sei_recovery_frame_cnt) {
+h->recovery_frame = av_mod_uintp2(h->poc.frame_num + 
sei_recovery_frame_cnt, h->ps.sps->log2_max_frame_num);
+
+if (!h->valid_recovery_point)
+h->recovery_frame = h->poc.frame_num;
+}
+}
+
+h->cur_pic_ptr->f->key_frame |= (nal->type == H264_NAL_IDR_SLICE);
+
+if (nal->type == H264_NAL_IDR_SLICE ||
+(h->recovery_frame == h->poc.frame_num && nal->ref_idc)) {
+h->recovery_frame = -1;
+h->cur_pic_ptr->recovered = 1;
+}
+// If we have an IDR, all frames after it in decoded order are
+// "recovered".
+if (nal->type == H264_NAL_IDR_SLICE)
+h->frame_recovered |= FRAME_RECOVERED_IDR;
+#if 1
+h->cur_pic_ptr->recovered |= h->frame_recovered;
+#else
+h->cur_pic_ptr->recovered |= !!(h->frame_recovered & FRAME_RECOVERED_IDR);
+#endif
+
 /* Set the frame properties/side data. Only done for the second field in
  * field coded frames, since some SEI information is present for each field
  * and is merged by the SEI parsing code. */
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index c72a7fc..9313301 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -802,38 +802,6 @@ again:
 if (sl->redundant_pic_count > 0)
 break;
 
-if (h->sei.recovery_point.recovery_frame_cnt >= 0) {
-const int sei_recovery_frame_cnt = 
h->sei.recovery_point.recovery_frame_cnt;
-
-if (h->poc.frame_num != sei_recovery_frame_cnt || 
sl->slice_type_nos != AV_PICTURE_TYPE_I)
-h->valid_recovery_point = 1;
-
-if (   h->recovery_frame < 0
-|| av_mod_uintp2(h->recovery_frame - h->poc.frame_num, 
h->ps.sps->log2_max_frame_num) > sei_recovery_frame_cnt) {
-h->recovery_frame = av_mod_uintp2(h->poc.frame_num + 
sei_recovery_frame_cnt, h->ps.sps->log2_max_frame_num);
-
-if (!h->valid_recovery_point)
-h->recovery_frame = h->poc.frame_num;
-}
-}
-
-h->cur_pic_ptr->f->key_frame |= (nal->type == H264_NAL_IDR_SLICE);
-
-if (nal->type == H264_NAL_IDR_SLICE ||
-(h->recovery_frame == h->poc.frame_num && nal->ref_idc)) {
-h->recovery_frame = -1;
-h->cur_pic_ptr->recovered = 1;
-}
-// If we have an IDR, all frames after it in decoded order are
-// "recovered".
-if (nal->type == H264_NAL_IDR_SLICE)
-h->frame_recovered |= FRAME_RECOVERED_IDR;
-#if 1
-h->cur_pic_ptr->recovered |= h->frame_recovered;
-#else
-h->cur_pic_ptr->recovered |= !!(h->frame_recovered & 
FRAME_RECOVERED_IDR);
-#endif
-
 if (h->current_slice == 1) {
 if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS))
 decode_postinit(h, i >= nals_needed);


==

diff --cc libavcodec/h264_slice.c
index c6f40e5,2b7e088..25a5890
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@@ -1499,6 -1335,24 +1499,38 @@@ static int h264_field_start(H264Contex
  
  h->picture_idr = nal->type == H264_NAL_IDR_SLICE;
  
 -if (h->sei.recovery_point.recovery_frame_cnt >= 0 && h->recovery_frame < 
0) {
 -h->recovery_frame = (h->poc.frame_num + 
h->sei.recovery_point.recovery_frame_cnt) &
 -((1 << h->ps.sps->log2_max_frame_num) - 1);
++if (h->sei.

[FFmpeg-cvslog] avformat: add a TTA Muxer

2016-08-04 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Aug  4 16:21:25 
2016 -0300| [376d4b3c0d9d779baef3e2a72ac1ffe77e8508b8] | committer: James Almer

avformat: add a TTA Muxer

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=376d4b3c0d9d779baef3e2a72ac1ffe77e8508b8
---

 Changelog|   1 +
 doc/general.texi |   2 +-
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   2 +-
 libavformat/ttaenc.c | 149 +++
 libavformat/version.h|   2 +-
 tests/fate/acodec.mak|   4 +-
 tests/fate/avformat.mak  |   2 +
 tests/lavf-regression.sh |   8 +++
 tests/ref/acodec/tta |   4 +-
 tests/ref/lavf/mka   |   3 +
 tests/ref/lavf/tta   |   3 +
 12 files changed, 174 insertions(+), 7 deletions(-)

diff --git a/Changelog b/Changelog
index 0f9b4cf..a0bf4d6 100644
--- a/Changelog
+++ b/Changelog
@@ -12,6 +12,7 @@ version :
 - 16-bit support in selectivecolor filter
 - OpenH264 decoder wrapper
 - MediaCodec hwaccel
+- True Audio (TTA) muxer
 
 
 version 3.1:
diff --git a/doc/general.texi b/doc/general.texi
index 6b5975c..74fc539 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -509,7 +509,7 @@ library:
 @tab Used on the Nintendo GameCube.
 @item Tiertex Limited SEQ   @tab   @tab X
 @tab Tiertex .seq files used in the DOS CD-ROM version of the game 
Flashback.
-@item True Audio@tab   @tab X
+@item True Audio@tab X @tab X
 @item VAG   @tab   @tab X
 @tab Audio format used in many Sony PS2 games.
 @item VC-1 test bitstream   @tab X @tab X
diff --git a/libavformat/Makefile b/libavformat/Makefile
index e2cb474..fda1e17 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -471,6 +471,7 @@ OBJS-$(CONFIG_TMV_DEMUXER)   += tmv.o
 OBJS-$(CONFIG_TRUEHD_DEMUXER)+= rawdec.o mlpdec.o
 OBJS-$(CONFIG_TRUEHD_MUXER)  += rawenc.o
 OBJS-$(CONFIG_TTA_DEMUXER)   += tta.o apetag.o img2.o
+OBJS-$(CONFIG_TTA_MUXER) += ttaenc.o apetag.o img2.o
 OBJS-$(CONFIG_TTY_DEMUXER)   += tty.o sauce.o
 OBJS-$(CONFIG_TXD_DEMUXER)   += txd.o
 OBJS-$(CONFIG_UNCODEDFRAMECRC_MUXER) += uncodedframecrcenc.o framehash.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 10c9bcc..a69195e 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -311,7 +311,7 @@ void av_register_all(void)
 REGISTER_MUXER   (MKVTIMESTAMP_V2,  mkvtimestamp_v2);
 REGISTER_DEMUXER (TMV,  tmv);
 REGISTER_MUXDEMUX(TRUEHD,   truehd);
-REGISTER_DEMUXER (TTA,  tta);
+REGISTER_MUXDEMUX(TTA,  tta);
 REGISTER_DEMUXER (TXD,  txd);
 REGISTER_DEMUXER (TTY,  tty);
 REGISTER_MUXER   (UNCODEDFRAMECRC,  uncodedframecrc);
diff --git a/libavformat/ttaenc.c b/libavformat/ttaenc.c
new file mode 100644
index 000..fdce1e3
--- /dev/null
+++ b/libavformat/ttaenc.c
@@ -0,0 +1,149 @@
+/*
+ * True Audio (TTA) muxer
+ * Copyright (c) 2016 James Almer
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/crc.h"
+#include "libavutil/intreadwrite.h"
+
+#include "apetag.h"
+#include "avformat.h"
+#include "avio_internal.h"
+#include "internal.h"
+
+typedef struct TTAMuxContext {
+AVIOContext *seek_table;
+AVIOContext *data;
+uint32_t nb_samples;
+int frame_size;
+int last_frame;
+} TTAMuxContext;
+
+static int tta_write_header(AVFormatContext *s)
+{
+TTAMuxContext *tta = s->priv_data;
+AVCodecParameters *par = s->streams[0]->codecpar;
+int ret;
+
+if (s->nb_streams != 1) {
+av_log(s, AV_LOG_ERROR, "Only one stream is supported\n");
+return AVERROR(EINVAL);
+}
+if (par->codec_id != AV_CODEC_ID_TTA) {
+av_log(s, AV_LOG_ERROR, "Unsupported codec\n");
+return AVERROR(EINVAL);
+}
+if (par->extradata && par->extradata_size < 22) {
+av_log(s, AV_LOG_ERROR, "Invalid TTA extradata\n");
+return AVERROR_INVALIDDATA;
+}
+
+if ((ret = avio_open_dyn_buf(&tta->seek_table)) < 0)
+return ret;
+if ((ret = avio_open_

[FFmpeg-cvslog] avformat/tta: remove custom crc callback function

2016-08-04 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Aug  4 16:17:44 
2016 -0300| [ce944e84892f1ba21602bd83b1a5d532dfdd1eda] | committer: James Almer

avformat/tta: remove custom crc callback function

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce944e84892f1ba21602bd83b1a5d532dfdd1eda
---

 libavformat/tta.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libavformat/tta.c b/libavformat/tta.c
index 02656ac..1447eff 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -35,12 +35,6 @@ typedef struct TTAContext {
 int last_frame_size;
 } TTAContext;
 
-static unsigned long tta_check_crc(unsigned long checksum, const uint8_t *buf,
-   unsigned int len)
-{
-return av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), checksum, buf, len);
-}
-
 static int tta_probe(AVProbeData *p)
 {
 if (AV_RL32(&p->buf[0]) == MKTAG('T', 'T', 'A', '1') &&
@@ -65,7 +59,7 @@ static int tta_read_header(AVFormatContext *s)
 start_offset = avio_tell(s->pb);
 if (start_offset < 0)
 return start_offset;
-ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
+ffio_init_checksum(s->pb, ff_crcEDB88320_update, UINT32_MAX);
 if (avio_rl32(s->pb) != AV_RL32("TTA1"))
 return AVERROR_INVALIDDATA;
 
@@ -121,7 +115,7 @@ static int tta_read_header(AVFormatContext *s)
 avio_seek(s->pb, start_offset, SEEK_SET);
 avio_read(s->pb, st->codecpar->extradata, st->codecpar->extradata_size);
 
-ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
+ffio_init_checksum(s->pb, ff_crcEDB88320_update, UINT32_MAX);
 for (i = 0; i < c->totalframes; i++) {
 uint32_t size = avio_rl32(s->pb);
 int r;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/avio: add a crc callback function for CRC-32 IEEE-LE

2016-08-04 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu Aug  4 16:17:09 
2016 -0300| [155f4e963021c5b8d6271d1e34219576dcff6906] | committer: James Almer

avformat/avio: add a crc callback function for CRC-32 IEEE-LE

Reviewed-by: Nicolas George 
Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=155f4e963021c5b8d6271d1e34219576dcff6906
---

 libavformat/avio_internal.h | 2 ++
 libavformat/aviobuf.c   | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 3867be6..fdb323c 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -111,6 +111,8 @@ void ffio_init_checksum(AVIOContext *s,
 unsigned long ffio_get_checksum(AVIOContext *s);
 unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
 unsigned int len);
+unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t *buf,
+unsigned int len);
 unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf,
 unsigned int len);
 
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 31e7202..f3acb32 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -560,6 +560,12 @@ unsigned long ff_crc04C11DB7_update(unsigned long 
checksum, const uint8_t *buf,
 return av_crc(av_crc_get_table(AV_CRC_32_IEEE), checksum, buf, len);
 }
 
+unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t *buf,
+unsigned int len)
+{
+return av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), checksum, buf, len);
+}
+
 unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf,
 unsigned int len)
 {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/vdpau: clean up vdpau_internal.h

2016-08-04 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Aug  3 01:20:52 
2016 -0300| [be63ef3c4e6399a3ef8d22cc25e9cb3575cf74ae] | committer: James Almer

avcodec/vdpau: clean up vdpau_internal.h

Also don't include it on files that don't need it.

This reduces differences with libav

Tested-by: Timothy Gu 
Reveiwed-by: Carl Eugen Hoyos 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be63ef3c4e6399a3ef8d22cc25e9cb3575cf74ae
---

 libavcodec/mpeg12.c |  1 -
 libavcodec/svq3.c   |  1 -
 libavcodec/vdpau_internal.h | 10 +-
 3 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 7c14052..a61d45b 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -39,7 +39,6 @@
 #include "mpeg12data.h"
 #include "mpegvideodata.h"
 #include "bytestream.h"
-#include "vdpau_internal.h"
 #include "thread.h"
 
 uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 223819f..bb4508c 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -53,7 +53,6 @@
 #include "mathops.h"
 #include "rectangle.h"
 #include "tpeldsp.h"
-#include "vdpau_internal.h"
 
 #if CONFIG_ZLIB
 #include 
diff --git a/libavcodec/vdpau_internal.h b/libavcodec/vdpau_internal.h
index 8a63733..77800af 100644
--- a/libavcodec/vdpau_internal.h
+++ b/libavcodec/vdpau_internal.h
@@ -24,15 +24,13 @@
 #ifndef AVCODEC_VDPAU_INTERNAL_H
 #define AVCODEC_VDPAU_INTERNAL_H
 
-#include "config.h"
 #include 
-#if CONFIG_VDPAU
 #include 
-#endif
 
 #include "libavutil/frame.h"
 
 #include "avcodec.h"
+#include "vdpau.h"
 
 /** Extract VdpVideoSurface from an AVFrame */
 static inline uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
@@ -40,8 +38,6 @@ static inline uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
 return (uintptr_t)pic->data[3];
 }
 
-struct vdpau_picture_context;
-#if CONFIG_VDPAU
 union VDPAUPictureInfo {
 VdpPictureInfoH264h264;
 VdpPictureInfoMPEG1Or2mpeg;
@@ -55,8 +51,6 @@ union VDPAUPictureInfo {
 #endif
 };
 
-#include "vdpau.h"
-
 typedef struct VDPAUHWContext {
 AVVDPAUContext context;
 VdpDevice device;
@@ -114,8 +108,6 @@ struct vdpau_picture_context {
 
 int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
  int level);
-#endif //CONFIG_VDPAU
-
 int ff_vdpau_common_uninit(AVCodecContext *avctx);
 
 int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat: Add av_get_frame_filename2() and AV_FRAME_FILENAME_FLAGS_MULTIPLE

2016-08-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Aug  3 20:34:20 2016 +0200| [82a33c8d858498fc4e0b8ab93ad323a05dfd5168] | 
committer: Michael Niedermayer

avformat: Add av_get_frame_filename2() and AV_FRAME_FILENAME_FLAGS_MULTIPLE

This will be used to allow writing file sequences using the tee output onto
multiple places in parallel

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=82a33c8d858498fc4e0b8ab93ad323a05dfd5168
---

 doc/APIchanges | 3 +++
 libavformat/avformat.h | 7 +++
 libavformat/utils.c| 9 +++--
 libavformat/version.h  | 2 +-
 4 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index bcd329f..209ab41 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-08-04 - xxx - lavf 57.46.100 - avformat.h
+  Add av_get_frame_filename2()
+
 2016-07-09 - xxx / 90f469a - lavc 57.50.100 / 57.20.0 - avcodec.h
   Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
 
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index b9fbb06..d8a6cf3 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2720,6 +2720,9 @@ void av_dump_format(AVFormatContext *ic,
 const char *url,
 int is_output);
 
+
+#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1 ///< Allow multiple %d
+
 /**
  * Return in 'buf' the path with '%d' replaced by a number.
  *
@@ -2730,8 +2733,12 @@ void av_dump_format(AVFormatContext *ic,
  * @param buf_size destination buffer size
  * @param path numbered sequence string
  * @param number frame number
+ * @param flags AV_FRAME_FILENAME_FLAGS_*
  * @return 0 if OK, -1 on format error
  */
+int av_get_frame_filename2(char *buf, int buf_size,
+  const char *path, int number, int flags);
+
 int av_get_frame_filename(char *buf, int buf_size,
   const char *path, int number);
 
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5a902ea..6b7609e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4315,7 +4315,7 @@ uint64_t ff_ntp_time(void)
 return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
 }
 
-int av_get_frame_filename(char *buf, int buf_size, const char *path, int 
number)
+int av_get_frame_filename2(char *buf, int buf_size, const char *path, int 
number, int flags)
 {
 const char *p;
 char *q, buf1[20], c;
@@ -4340,7 +4340,7 @@ int av_get_frame_filename(char *buf, int buf_size, const 
char *path, int number)
 case '%':
 goto addchar;
 case 'd':
-if (percentd_found)
+if (!(flags & AV_FRAME_FILENAME_FLAGS_MULTIPLE) && 
percentd_found)
 goto fail;
 percentd_found = 1;
 if (number < 0)
@@ -4370,6 +4370,11 @@ fail:
 return -1;
 }
 
+int av_get_frame_filename(char *buf, int buf_size, const char *path, int 
number)
+{
+return av_get_frame_filename2(buf, buf_size, path, number, 0);
+}
+
 void av_url_split(char *proto, int proto_size,
   char *authorization, int authorization_size,
   char *hostname, int hostname_size,
diff --git a/libavformat/version.h b/libavformat/version.h
index 8899bfd..07df407 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you belive might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  45
+#define LIBAVFORMAT_VERSION_MINOR  46
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/hlsenc: Use AV_FRAME_FILENAME_FLAGS_MULTIPLE, support tee:

2016-08-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Aug  3 20:35:53 2016 +0200| [dd96a5847319db8aecf9819336611fff04cb2941] | 
committer: Michael Niedermayer

avformat/hlsenc: Use AV_FRAME_FILENAME_FLAGS_MULTIPLE, support tee:

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd96a5847319db8aecf9819336611fff04cb2941
---

 libavformat/hlsenc.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 5dc518d..9f076ba 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -561,14 +561,16 @@ static int hls_start(AVFormatContext *s)
 }
 av_free(fn_copy);
 }
-} else if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
-  c->basename, c->wrap ? c->sequence % c->wrap 
: c->sequence) < 0) {
+} else if (av_get_frame_filename2(oc->filename, sizeof(oc->filename),
+  c->basename, c->wrap ? c->sequence % c->wrap 
: c->sequence,
+  AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) {
 av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s' 
you can try use -use_localtime 1 with it\n", c->basename);
 return AVERROR(EINVAL);
 }
 if( c->vtt_basename) {
-if (av_get_frame_filename(vtt_oc->filename, 
sizeof(vtt_oc->filename),
-  c->vtt_basename, c->wrap ? c->sequence % c->wrap 
: c->sequence) < 0) {
+if (av_get_frame_filename2(vtt_oc->filename, 
sizeof(vtt_oc->filename),
+  c->vtt_basename, c->wrap ? c->sequence % c->wrap 
: c->sequence,
+  AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) {
 av_log(vtt_oc, AV_LOG_ERROR, "Invalid segment filename 
template '%s'\n", c->vtt_basename);
 return AVERROR(EINVAL);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/img2enc: Use AV_FRAME_FILENAME_FLAGS_MULTIPLE, support tee:

2016-08-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Aug  3 20:36:14 2016 +0200| [1fb8f6b75cb82607401852d9f0ac0e3f10b183b1] | 
committer: Michael Niedermayer

avformat/img2enc: Use AV_FRAME_FILENAME_FLAGS_MULTIPLE, support tee:

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1fb8f6b75cb82607401852d9f0ac0e3f10b183b1
---

 libavformat/img2enc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 32c68e4..1297b1a 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -97,7 +97,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 av_log(s, AV_LOG_ERROR, "Could not get frame filename with 
strftime\n");
 return AVERROR(EINVAL);
 }
-} else if (av_get_frame_filename(filename, sizeof(filename), 
img->path, img->img_number) < 0 &&
+} else if (av_get_frame_filename2(filename, sizeof(filename), 
img->path,
+  img->img_number,
+  AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 
0 &&
img->img_number > 1) {
 av_log(s, AV_LOG_ERROR,
"Could not get frame filename number %d from pattern '%s' 
(either set updatefirst or use a pattern like %%03d within the filename 
pattern)\n",

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog