[FFmpeg-cvslog] ffmpeg: remove unused and errorneous AVFrame timestamp check

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sat Oct  1 
16:15:45 2016 +0200| [04a3577263782cd6d70722d4ae18d75fee03dbc4] | committer: 
Hendrik Leppkes

ffmpeg: remove unused and errorneous AVFrame timestamp check

Decoders have previously not used AVFrame.pts, and with the upcoming
deprecation of pkt_pts (in favor of pts), this would lead to an errorneous
interpration of timestamps.

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

 ffmpeg.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 44371f0b..6748ad8 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2108,12 +2108,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, 
int *got_output)
 }
 }
 
-/* if the decoder provides a pts, use it instead of the last packet pts.
-   the decoder could be delaying output by a packet or more. */
-if (decoded_frame->pts != AV_NOPTS_VALUE) {
-ist->dts = ist->next_dts = ist->pts = ist->next_pts = 
av_rescale_q(decoded_frame->pts, avctx->time_base, AV_TIME_BASE_Q);
-decoded_frame_tb   = avctx->time_base;
-} else if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
+if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
 decoded_frame->pts = decoded_frame->pkt_pts;
 decoded_frame_tb   = ist->st->time_base;
 } else if (pkt && pkt->pts != AV_NOPTS_VALUE) {

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


[FFmpeg-cvslog] lavc: export the timestamps when decoding in AVFrame.pts

2016-10-07 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat Mar 19 
21:45:24 2016 +0100| [32c8359093d1ff4f45ed19518b449b3ac3769d27] | committer: 
Anton Khirnov

lavc: export the timestamps when decoding in AVFrame.pts

Currently it's exported as AVFrame.pkt_pts, which is also the only use
for that field. The reason it is done like this is that lavc used to
export various codec-specific "timing" information in AVFrame.pts, which
is not done anymore.

Since it is confusing to the callers to have a separate field which is
used only for decoder timestamps and nothing else, deprecate pkt_pts and
use just AVFrame.pts everywhere.

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

 doc/APIchanges  |  4 
 libavcodec/libschroedingerdec.c |  7 ++-
 libavcodec/mmaldec.c|  7 ++-
 libavcodec/qsvdec.c |  7 ++-
 libavcodec/utils.c  | 10 ++
 libavcodec/version.h|  2 +-
 libavutil/frame.c   |  4 
 libavutil/frame.h   |  4 
 libavutil/version.h |  3 +++
 9 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 74316ed..1caa1b7 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavc 57.24.0 - avcodec.h
+  Decoders now export the frame timestamp as AVFrame.pts. It was
+  previously exported as AVFrame.pkt_pts, which is now deprecated.
+
 2016-xx-xx - xxx - lavu 55.16.0 - hwcontext.h hwcontext_qsv.h
   Add AV_HWDEVICE_TYPE_QSV and a new installed header with QSV-specific
   hwcontext definitions.
diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c
index fb0781e..f173f92 100644
--- a/libavcodec/libschroedingerdec.c
+++ b/libavcodec/libschroedingerdec.c
@@ -326,7 +326,12 @@ static int libschroedinger_decode_frame(AVCodecContext 
*avctx,
framewithpts->frame->components[2].length);
 
 /* Fill frame with current buffer data from Schroedinger. */
-avframe->pkt_pts = framewithpts->pts;
+avframe->pts = framewithpts->pts;
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
+avframe->pkt_pts = avframe->pts;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 avframe->linesize[0] = framewithpts->frame->components[0].stride;
 avframe->linesize[1] = framewithpts->frame->components[1].stride;
 avframe->linesize[2] = framewithpts->frame->components[2].stride;
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 193df7e..69258a2 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -631,7 +631,12 @@ static int ffmal_copy_frame(AVCodecContext *avctx,  
AVFrame *frame,
   avctx->pix_fmt, avctx->width, avctx->height);
 }
 
-frame->pkt_pts = buffer->pts == MMAL_TIME_UNKNOWN ? AV_NOPTS_VALUE : 
buffer->pts;
+frame->pts = buffer->pts == MMAL_TIME_UNKNOWN ? AV_NOPTS_VALUE : 
buffer->pts;
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
+frame->pkt_pts = frame->pts;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 frame->pkt_dts = AV_NOPTS_VALUE;
 
 done:
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index ac7a1e6..0215761 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -352,7 +352,12 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
 
 outsurf = out_frame->surface;
 
-frame->pkt_pts = frame->pts = outsurf->Data.TimeStamp;
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
+frame->pkt_pts = outsurf->Data.TimeStamp;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+frame->pts = outsurf->Data.TimeStamp;
 
 frame->repeat_pict =
 outsurf->Info.PicStruct & MFX_PICSTRUCT_FRAME_TRIPLING ? 4 :
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8f8efec..bc1beee 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -551,11 +551,21 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame 
*frame)
 
 frame->reordered_opaque = avctx->reordered_opaque;
 if (!pkt) {
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
 frame->pkt_pts = AV_NOPTS_VALUE;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+frame->pts = AV_NOPTS_VALUE;
 return 0;
 }
 
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
 frame->pkt_pts = pkt->pts;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+frame->pts = pkt->pts;
 
 for (i = 0; i < FF_ARRAY_ELEMS(sd); i++) {
 int size;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 9b495e9..3b154f8 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR 23
+#define LIBAVCODEC_VERSION_MINOR 24
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, 

[FFmpeg-cvslog] Use AVFrame.pts instead of deprecated pkt_pts.

2016-10-07 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun Mar 20 
07:51:11 2016 +0100| [beb62dac629603eb074a44c44389c230b5caac7c] | committer: 
Anton Khirnov

Use AVFrame.pts instead of deprecated pkt_pts.

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

 avconv.c | 2 +-
 avplay.c | 4 ++--
 libavfilter/vsrc_movie.c | 2 --
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/avconv.c b/avconv.c
index 385eb2c..bd84d9b 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1279,7 +1279,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, 
int *got_output)
 }
 ist->hwaccel_retrieved_pix_fmt = decoded_frame->format;
 
-decoded_frame->pts = guess_correct_pts(&ist->pts_ctx, 
decoded_frame->pkt_pts,
+decoded_frame->pts = guess_correct_pts(&ist->pts_ctx, decoded_frame->pts,
decoded_frame->pkt_dts);
 
 if (ist->st->sample_aspect_ratio.num)
diff --git a/avplay.c b/avplay.c
index 0e128af..4770132 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1406,9 +1406,9 @@ static int get_video_frame(PlayerState *is, AVFrame 
*frame, int64_t *pts, AVPack
 
 if (got_picture) {
 if (decoder_reorder_pts == -1) {
-*pts = guess_correct_pts(&is->pts_ctx, frame->pkt_pts, 
frame->pkt_dts);
+*pts = guess_correct_pts(&is->pts_ctx, frame->pts, frame->pkt_dts);
 } else if (decoder_reorder_pts) {
-*pts = frame->pkt_pts;
+*pts = frame->pts;
 } else {
 *pts = frame->pkt_dts;
 }
diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c
index 95ef4f1..5989a59 100644
--- a/libavfilter/vsrc_movie.c
+++ b/libavfilter/vsrc_movie.c
@@ -228,8 +228,6 @@ static int movie_get_frame(AVFilterLink *outlink)
 avcodec_decode_video2(movie->codec_ctx, movie->frame, 
&frame_decoded, &pkt);
 
 if (frame_decoded) {
-if (movie->frame->pkt_pts != AV_NOPTS_VALUE)
-movie->frame->pts = movie->frame->pkt_pts;
 av_log(outlink->src, AV_LOG_TRACE,
 "movie_get_frame(): file:'%s' pts:%"PRId64" time:%f 
aspect:%d/%d\n",
 movie->file_name, movie->frame->pts,

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


[FFmpeg-cvslog] Merge commit 'dc7501e524dc3270335749302c7aa449973625f3'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:18:05 2016 +0200| [6fc74934de1fcd82ace75dfff17605ec41c7e90d] | committer: 
Hendrik Leppkes

Merge commit 'dc7501e524dc3270335749302c7aa449973625f3'

* commit 'dc7501e524dc3270335749302c7aa449973625f3':
  checkasm: Issue emms after benchmarking functions

Merged-by: Hendrik Leppkes 

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

 tests/checkasm/checkasm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 17374b4..7877251 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -27,6 +27,7 @@
 #include "config.h"
 #include "libavutil/avstring.h"
 #include "libavutil/cpu.h"
+#include "libavutil/internal.h"
 #include "libavutil/lfg.h"
 #include "libavutil/timer.h"
 
@@ -167,6 +168,7 @@ void checkasm_checked_call(void *func, ...);
 tcount++;\
 }\
 }\
+emms_c();\
 checkasm_update_bench(tcount, tsum);\
 }\
 } while (0)


==


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


[FFmpeg-cvslog] checkasm: Issue emms after benchmarking functions

2016-10-07 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Tue Jun 21 
14:00:01 2016 +0300| [dc7501e524dc3270335749302c7aa449973625f3] | committer: 
Martin Storsjö

checkasm: Issue emms after benchmarking functions

The functions may not clean up properly after using MMX
registers. For the normal testing calls, the checkasm_checked_call
functions will do the cleanup (and check that functions that
should clean up do it as well), but when benchmarking functions
that don't clean up, we don't currently properly clean up at all.

This causes issues if a benchmarked function is followed by testing
of a function that is supposed to not clobber the MMX/FPU state but
doesn't touch it at all.

Signed-off-by: Martin Storsjö 

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

 tests/checkasm/checkasm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 619ebc7..0faf3ba 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -27,6 +27,7 @@
 #include "config.h"
 #include "libavutil/avstring.h"
 #include "libavutil/cpu.h"
+#include "libavutil/internal.h"
 #include "libavutil/lfg.h"
 #include "libavutil/timer.h"
 
@@ -161,6 +162,7 @@ void checkasm_checked_call(void *func, ...);
 tcount++;\
 }\
 }\
+emms_c();\
 checkasm_update_bench(tcount, tsum);\
 }\
 } while (0)

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


[FFmpeg-cvslog] Merge commit '8c3c7b8920033d61c7aa15a4465b759c84e5958f'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:19:06 2016 +0200| [40b2878ad3bb12d91b15a7278b6a8862c09f4d54] | committer: 
Hendrik Leppkes

Merge commit '8c3c7b8920033d61c7aa15a4465b759c84e5958f'

* commit '8c3c7b8920033d61c7aa15a4465b759c84e5958f':
  dxva2_h264: Remove an unused variable

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] vaapi_encode: Fix fallback when input does not match any format

2016-10-07 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sat Jun 18 13:05:23 
2016 +0100| [11b8030309ee93d79b3a6cd4b83bf00757db1598] | committer: Mark 
Thompson

vaapi_encode: Fix fallback when input does not match any format

Just a typo.  Add a comment to make it clearer what it's doing.

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

 libavcodec/vaapi_encode.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 45f5e57..c3f4e44 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1114,8 +1114,11 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx,
 break;
 }
 }
-if (recon_format == AV_PIX_FMT_NONE)
-recon_format = constraints->valid_sw_formats[i];
+if (recon_format == AV_PIX_FMT_NONE) {
+// No match.  Just use the first in the supported list and
+// hope for the best.
+recon_format = constraints->valid_sw_formats[0];
+}
 } else {
 // No idea what to use; copy input format.
 recon_format = ctx->input_frames->sw_format;

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


[FFmpeg-cvslog] Merge commit '11b8030309ee93d79b3a6cd4b83bf00757db1598'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:19:32 2016 +0200| [5e872d908368e7a246f37e28df1f67e8c4fb08b9] | committer: 
Hendrik Leppkes

Merge commit '11b8030309ee93d79b3a6cd4b83bf00757db1598'

* commit '11b8030309ee93d79b3a6cd4b83bf00757db1598':
  vaapi_encode: Fix fallback when input does not match any format

Merged-by: Hendrik Leppkes 

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

 libavcodec/vaapi_encode.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 8c9a3bd..21a8656 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1114,8 +1114,11 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx,
 break;
 }
 }
-if (recon_format == AV_PIX_FMT_NONE)
-recon_format = constraints->valid_sw_formats[i];
+if (recon_format == AV_PIX_FMT_NONE) {
+// No match.  Just use the first in the supported list and
+// hope for the best.
+recon_format = constraints->valid_sw_formats[0];
+}
 } else {
 // No idea what to use; copy input format.
 recon_format = ctx->input_frames->sw_format;


==


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


[FFmpeg-cvslog] dxva2_h264: Remove an unused variable

2016-10-07 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Tue Jun 21 
14:13:40 2016 +0300| [8c3c7b8920033d61c7aa15a4465b759c84e5958f] | committer: 
Martin Storsjö

dxva2_h264: Remove an unused variable

This was introduced by mistake in 39cdbb12aa214 (only one of the
added variables were really needed).

Signed-off-by: Martin Storsjö 

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

 libavcodec/dxva2_h264.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index 52c59fb..5622c22 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -166,7 +166,6 @@ static void fill_picture_parameters(const AVCodecContext 
*avctx, AVDXVAContext *
 static void fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext 
*ctx, const H264Context *h, DXVA_Qmatrix_H264 *qm)
 {
 unsigned i, j;
-const SPS *sps = h->ps.sps;
 const PPS *pps = h->ps.pps;
 memset(qm, 0, sizeof(*qm));
 if (DXVA_CONTEXT_WORKAROUND(avctx, ctx) & 
FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) {

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


[FFmpeg-cvslog] Merge commit '4dbfcd07570a9e45e9597561023adb6da26f27f6'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:20:04 2016 +0200| [8dd0e3d50f8488a00fdb59b0794358a0ba334c00] | committer: 
Hendrik Leppkes

Merge commit '4dbfcd07570a9e45e9597561023adb6da26f27f6'

* commit '4dbfcd07570a9e45e9597561023adb6da26f27f6':
  librtmp: Avoid an infiniloop setting connection arguments

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] Merge commit 'fe498ef5144d3712b887f44a0c5e654add99ead7'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:19:53 2016 +0200| [e8487d71be4dfaa3b9be519936ac74917d956d8a] | committer: 
Hendrik Leppkes

Merge commit 'fe498ef5144d3712b887f44a0c5e654add99ead7'

* commit 'fe498ef5144d3712b887f44a0c5e654add99ead7':
  hwcontext_vaapi: Return all formats for constraints without config

Merged-by: Hendrik Leppkes 

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

 libavutil/hwcontext_vaapi.c | 190 ++--
 1 file changed, 79 insertions(+), 111 deletions(-)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 92fa235..cfa25bc 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -155,114 +155,100 @@ static int 
vaapi_frames_get_constraints(AVHWDeviceContext *hwdev,
 {
 AVVAAPIDeviceContext *hwctx = hwdev->hwctx;
 const AVVAAPIHWConfig *config = hwconfig;
-AVVAAPIHWConfig *tmp_config;
+VAAPIDeviceContext *ctx = hwdev->internal->priv;
 VASurfaceAttrib *attr_list = NULL;
 VAStatus vas;
 enum AVPixelFormat pix_fmt;
 unsigned int fourcc;
 int err, i, j, attr_count, pix_fmt_count;
 
-if (!hwconfig) {
-// No configuration was provided, so we create a temporary pipeline
-// configuration in order to query all supported image formats.
-
-tmp_config = av_mallocz(sizeof(*config));
-if (!tmp_config)
-return AVERROR(ENOMEM);
-
-vas = vaCreateConfig(hwctx->display,
- VAProfileNone, VAEntrypointVideoProc,
- NULL, 0, &tmp_config->config_id);
+if (config) {
+attr_count = 0;
+vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
+   0, &attr_count);
 if (vas != VA_STATUS_SUCCESS) {
-// No vpp.  We might still be able to do something useful if
-// codecs are supported, so try to make the most-commonly
-// supported decoder configuration we can to query instead.
-vas = vaCreateConfig(hwctx->display,
- VAProfileH264ConstrainedBaseline,
- VAEntrypointVLD, NULL, 0,
- &tmp_config->config_id);
-if (vas != VA_STATUS_SUCCESS) {
-av_freep(&tmp_config);
-return AVERROR(ENOSYS);
-}
+av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
+   "%d (%s).\n", vas, vaErrorStr(vas));
+err = AVERROR(ENOSYS);
+goto fail;
 }
 
-config = tmp_config;
-}
-
-attr_count = 0;
-vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
-   0, &attr_count);
-if (vas != VA_STATUS_SUCCESS) {
-av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
-   "%d (%s).\n", vas, vaErrorStr(vas));
-err = AVERROR(ENOSYS);
-goto fail;
-}
+attr_list = av_malloc(attr_count * sizeof(*attr_list));
+if (!attr_list) {
+err = AVERROR(ENOMEM);
+goto fail;
+}
 
-attr_list = av_malloc(attr_count * sizeof(*attr_list));
-if (!attr_list) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
+   attr_list, &attr_count);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
+   "%d (%s).\n", vas, vaErrorStr(vas));
+err = AVERROR(ENOSYS);
+goto fail;
+}
 
-vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
-   attr_list, &attr_count);
-if (vas != VA_STATUS_SUCCESS) {
-av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
-   "%d (%s).\n", vas, vaErrorStr(vas));
-err = AVERROR(ENOSYS);
-goto fail;
-}
+pix_fmt_count = 0;
+for (i = 0; i < attr_count; i++) {
+switch (attr_list[i].type) {
+case VASurfaceAttribPixelFormat:
+fourcc = attr_list[i].value.value.i;
+pix_fmt = vaapi_pix_fmt_from_fourcc(fourcc);
+if (pix_fmt != AV_PIX_FMT_NONE) {
+++pix_fmt_count;
+} else {
+// Something unsupported - ignore.
+}
+break;
+case VASurfaceAttribMinWidth:
+constraints->min_width  = attr_list[i].value.value.i;
+break;
+case VASurfaceAttribMinHeight:
+constraints->min_height = attr_list[i].value.value.i;
+break;
+case VASurfaceAttribMaxWidth:
+co

[FFmpeg-cvslog] librtmp: Avoid an infiniloop setting connection arguments

2016-10-07 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Wed Jun 22 
06:36:31 2016 +0200| [4dbfcd07570a9e45e9597561023adb6da26f27f6] | committer: 
Luca Barbato

librtmp: Avoid an infiniloop setting connection arguments

The exit condition was missing.

CC: libav-sta...@libav.org

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

 libavformat/librtmp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 2e5e641..97c8ad6 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -189,6 +189,8 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 
 if (sep)
 p = sep + 1;
+else
+break;
 }
 }
 if (ctx->playpath) {

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


[FFmpeg-cvslog] hwcontext_vaapi: Return all formats for constraints without config

2016-10-07 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sat Jun 18 14:10:13 
2016 +0100| [fe498ef5144d3712b887f44a0c5e654add99ead7] | committer: Mark 
Thompson

hwcontext_vaapi: Return all formats for constraints without config

No longer make a dummy device configuration to query.  Instead, just
return everything we recognise from the whole format list.  Also
change the device setup code to query that list only, rather than
intersecting it with the constraint output.

This makes hwupload more usable on mesa/gallium where the video
processor only declares support for RGB formats, making it unable to
deal with YUV formats before this patch.  It might introduce some
different trickier failures in the internal upload/download code
because the set of allowed formats there has changed, though I didn't
find any obvious regressions with i965.

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

 libavutil/hwcontext_vaapi.c | 190 ++--
 1 file changed, 79 insertions(+), 111 deletions(-)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 4563e14..1bdc4cb 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -153,114 +153,100 @@ static int 
vaapi_frames_get_constraints(AVHWDeviceContext *hwdev,
 {
 AVVAAPIDeviceContext *hwctx = hwdev->hwctx;
 const AVVAAPIHWConfig *config = hwconfig;
-AVVAAPIHWConfig *tmp_config;
+VAAPIDeviceContext *ctx = hwdev->internal->priv;
 VASurfaceAttrib *attr_list = NULL;
 VAStatus vas;
 enum AVPixelFormat pix_fmt;
 unsigned int fourcc;
 int err, i, j, attr_count, pix_fmt_count;
 
-if (!hwconfig) {
-// No configuration was provided, so we create a temporary pipeline
-// configuration in order to query all supported image formats.
-
-tmp_config = av_mallocz(sizeof(*config));
-if (!tmp_config)
-return AVERROR(ENOMEM);
-
-vas = vaCreateConfig(hwctx->display,
- VAProfileNone, VAEntrypointVideoProc,
- NULL, 0, &tmp_config->config_id);
+if (config) {
+attr_count = 0;
+vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
+   0, &attr_count);
 if (vas != VA_STATUS_SUCCESS) {
-// No vpp.  We might still be able to do something useful if
-// codecs are supported, so try to make the most-commonly
-// supported decoder configuration we can to query instead.
-vas = vaCreateConfig(hwctx->display,
- VAProfileH264ConstrainedBaseline,
- VAEntrypointVLD, NULL, 0,
- &tmp_config->config_id);
-if (vas != VA_STATUS_SUCCESS) {
-av_freep(&tmp_config);
-return AVERROR(ENOSYS);
-}
+av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
+   "%d (%s).\n", vas, vaErrorStr(vas));
+err = AVERROR(ENOSYS);
+goto fail;
 }
 
-config = tmp_config;
-}
-
-attr_count = 0;
-vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
-   0, &attr_count);
-if (vas != VA_STATUS_SUCCESS) {
-av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
-   "%d (%s).\n", vas, vaErrorStr(vas));
-err = AVERROR(ENOSYS);
-goto fail;
-}
+attr_list = av_malloc(attr_count * sizeof(*attr_list));
+if (!attr_list) {
+err = AVERROR(ENOMEM);
+goto fail;
+}
 
-attr_list = av_malloc(attr_count * sizeof(*attr_list));
-if (!attr_list) {
-err = AVERROR(ENOMEM);
-goto fail;
-}
+vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
+   attr_list, &attr_count);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
+   "%d (%s).\n", vas, vaErrorStr(vas));
+err = AVERROR(ENOSYS);
+goto fail;
+}
 
-vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
-   attr_list, &attr_count);
-if (vas != VA_STATUS_SUCCESS) {
-av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
-   "%d (%s).\n", vas, vaErrorStr(vas));
-err = AVERROR(ENOSYS);
-goto fail;
-}
+pix_fmt_count = 0;
+for (i = 0; i < attr_count; i++) {
+switch (attr_list[i].type) {
+case VASurfaceAttribPixelFormat:
+fourcc = attr_list[i].value.value.i;
+pix_fmt = vaapi_pix_fmt_from_fourcc(fourcc);
+if (pix_fmt != AV_PIX_FMT_NONE) {
+++pix_

[FFmpeg-cvslog] Merge commit '3c84eaae9da0dc450ae99c65bb6b9865e3ba7fad'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:21:51 2016 +0200| [da76175d681246b07d526a395552edc020f0f4d9] | committer: 
Hendrik Leppkes

Merge commit '3c84eaae9da0dc450ae99c65bb6b9865e3ba7fad'

* commit '3c84eaae9da0dc450ae99c65bb6b9865e3ba7fad':
  h264: Eliminate unused but set variable

Noop, the variable doesn't exist in our code.

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] h264: Eliminate unused but set variable

2016-10-07 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Tue Jun 21 
13:24:41 2016 +0200| [3c84eaae9da0dc450ae99c65bb6b9865e3ba7fad] | committer: 
Diego Biurrun

h264: Eliminate unused but set variable

libavcodec/h264_slice.c:1384:9: warning: variable 'droppable' set but not used

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

 libavcodec/h264_slice.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 2b7e088..aa53570 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1378,8 +1378,7 @@ static int h264_slice_header_parse(H264SliceContext *sl, 
const H2645NAL *nal,
 const PPS *pps;
 int ret;
 unsigned int slice_type, tmp, i;
-int field_pic_flag, bottom_field_flag;
-int droppable, picture_structure;
+int field_pic_flag, bottom_field_flag, picture_structure;
 
 sl->first_mb_addr = get_ue_golomb(&sl->gb);
 
@@ -1430,7 +1429,6 @@ static int h264_slice_header_parse(H264SliceContext *sl, 
const H2645NAL *nal,
 
 sl->mb_mbaff   = 0;
 
-droppable = nal->ref_idc == 0;
 if (sps->frame_mbs_only_flag) {
 picture_structure = PICT_FRAME;
 } else {

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


[FFmpeg-cvslog] msmpeg4: Remove some broken, commented-out cruft

2016-10-07 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Jun 23 
14:36:37 2016 +0200| [eedbeb4c2737f28844157fae4bd87ed42a61bb1d] | committer: 
Diego Biurrun

msmpeg4: Remove some broken, commented-out cruft

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

 libavcodec/msmpeg4dec.c | 26 --
 1 file changed, 26 deletions(-)

diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 7c22b37..27c9f6d 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -752,35 +752,9 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 if(sign) level= -level;
 }
 
-#if 0 // waste of time / this will detect very few errors
-{
-const int abs_level= FFABS(level);
-const int run1= run - rl->max_run[last][abs_level] - 
run_diff;
-if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
-if(abs_level <= rl->max_level[last][run]){
-av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
esc, vlc encoding possible\n");
-return DECODING_AC_LOST;
-}
-if(abs_level <= rl->max_level[last][run]*2){
-av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
esc, esc 1 encoding possible\n");
-return DECODING_AC_LOST;
-}
-if(run1>=0 && abs_level <= 
rl->max_level[last][run1]){
-av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
esc, esc 2 encoding possible\n");
-return DECODING_AC_LOST;
-}
-}
-}
-#endif
 //level = level * qmul + (level>0) * qadd - (level<=0) * 
qadd ;
 if (level>0) level= level * qmul + qadd;
 else level= level * qmul - qadd;
-#if 0 // waste of time too :(
-if(level>2048 || level<-2048){
-av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. 
esc\n");
-return DECODING_AC_LOST;
-}
-#endif
 i+= run + 1;
 if(last) i+=192;
 #ifdef ERROR_DETAILS

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


[FFmpeg-cvslog] Merge commit 'eedbeb4c2737f28844157fae4bd87ed42a61bb1d'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:22:25 2016 +0200| [5114c62902d3726b898df5628b1eaf98b4a87027] | committer: 
Hendrik Leppkes

Merge commit 'eedbeb4c2737f28844157fae4bd87ed42a61bb1d'

* commit 'eedbeb4c2737f28844157fae4bd87ed42a61bb1d':
  msmpeg4: Remove some broken, commented-out cruft

Merged-by: Hendrik Leppkes 

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

 libavcodec/msmpeg4dec.c | 26 --
 1 file changed, 26 deletions(-)

diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 2f90877..eb56dc1 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -762,35 +762,9 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 if(sign) level= -level;
 }
 
-#if 0 // waste of time / this will detect very few errors
-{
-const int abs_level= FFABS(level);
-const int run1= run - rl->max_run[last][abs_level] - 
run_diff;
-if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
-if(abs_level <= rl->max_level[last][run]){
-av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
esc, vlc encoding possible\n");
-return DECODING_AC_LOST;
-}
-if(abs_level <= rl->max_level[last][run]*2){
-av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
esc, esc 1 encoding possible\n");
-return DECODING_AC_LOST;
-}
-if(run1>=0 && abs_level <= 
rl->max_level[last][run1]){
-av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
esc, esc 2 encoding possible\n");
-return DECODING_AC_LOST;
-}
-}
-}
-#endif
 //level = level * qmul + (level>0) * qadd - (level<=0) * 
qadd ;
 if (level>0) level= level * qmul + qadd;
 else level= level * qmul - qadd;
-#if 0 // waste of time too :(
-if(level>2048 || level<-2048){
-av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. 
esc\n");
-return DECODING_AC_LOST;
-}
-#endif
 i+= run + 1;
 if(last) i+=192;
 #ifdef ERROR_DETAILS


==


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


[FFmpeg-cvslog] Merge commit '4f98bb7b6d0323d9ecc3bebd6e24d46a3a374bad'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:23:38 2016 +0200| [2335e189fb7bcbee2eac6ec9a5756c29f6782a5b] | committer: 
Hendrik Leppkes

Merge commit '4f98bb7b6d0323d9ecc3bebd6e24d46a3a374bad'

* commit '4f98bb7b6d0323d9ecc3bebd6e24d46a3a374bad':
  msmpeg4: Remove commented-out debug logging code

Merged-by: Hendrik Leppkes 

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

 libavcodec/msmpeg4dec.c | 25 -
 1 file changed, 25 deletions(-)

diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index eb56dc1..77e8509 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -638,7 +638,6 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int 
*dir_ptr)
 return level;
 }
 
-//#define ERROR_DETAILS
 int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
   int n, int coded, const uint8_t *scan_table)
 {
@@ -767,12 +766,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 else level= level * qmul - qadd;
 i+= run + 1;
 if(last) i+=192;
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC3 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC3 i=%d 
run=%d level=%d\n", i, run, level);
-#endif
 } else {
 /* second escape */
 SKIP_BITS(re, &s->gb, 2);
@@ -780,12 +773,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 i+= run + rl->max_run[run>>7][level/qmul] + run_diff; 
//FIXME opt indexing
 level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - 
SHOW_SBITS(re, &s->gb, 1);
 LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC2 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC2 i=%d 
run=%d level=%d\n", i, run, level);
-#endif
 }
 } else {
 /* first escape */
@@ -795,23 +782,11 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 level = level + rl->max_level[run>>7][(run-1)&63] * 
qmul;//FIXME opt indexing
 level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
&s->gb, 1);
 LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC1 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC1 i=%d 
run=%d level=%d\n", i, run, level);
-#endif
 }
 } else {
 i+= run;
 level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
&s->gb, 1);
 LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow i=%d run=%d 
level=%d\n", i, run, level);
-#endif
 }
 if (i > 62){
 i-= 192;


==


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


[FFmpeg-cvslog] msmpeg4: Remove commented-out debug logging code

2016-10-07 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Jun 23 
14:43:45 2016 +0200| [4f98bb7b6d0323d9ecc3bebd6e24d46a3a374bad] | committer: 
Diego Biurrun

msmpeg4: Remove commented-out debug logging code

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

 libavcodec/msmpeg4dec.c | 25 -
 1 file changed, 25 deletions(-)

diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 27c9f6d..06ae9be 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -627,7 +627,6 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int 
*dir_ptr)
 return level;
 }
 
-//#define ERROR_DETAILS
 int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
   int n, int coded, const uint8_t *scan_table)
 {
@@ -757,12 +756,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 else level= level * qmul - qadd;
 i+= run + 1;
 if(last) i+=192;
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC3 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC3 i=%d 
run=%d level=%d\n", i, run, level);
-#endif
 } else {
 /* second escape */
 SKIP_BITS(re, &s->gb, 2);
@@ -770,12 +763,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 i+= run + rl->max_run[run>>7][level/qmul] + run_diff; 
//FIXME opt indexing
 level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - 
SHOW_SBITS(re, &s->gb, 1);
 LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC2 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC2 i=%d 
run=%d level=%d\n", i, run, level);
-#endif
 }
 } else {
 /* first escape */
@@ -785,23 +772,11 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * 
block,
 level = level + rl->max_level[run>>7][(run-1)&63] * 
qmul;//FIXME opt indexing
 level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
&s->gb, 1);
 LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC1 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC1 i=%d 
run=%d level=%d\n", i, run, level);
-#endif
 }
 } else {
 i+= run;
 level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
&s->gb, 1);
 LAST_SKIP_BITS(re, &s->gb, 1);
-#ifdef ERROR_DETAILS
-if(run==66)
-av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code 
level=%d\n", level);
-else if((i>62 && i<192) || i>192+63)
-av_log(s->avctx, AV_LOG_ERROR, "run overflow i=%d run=%d 
level=%d\n", i, run, level);
-#endif
 }
 if (i > 62){
 i-= 192;

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


[FFmpeg-cvslog] Merge commit '31aa5335c390c83a6c3ea955b155067c36c4a2c4'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:23:49 2016 +0200| [edb4c445119501070cb00be1696d47c6d6462e2a] | committer: 
Hendrik Leppkes

Merge commit '31aa5335c390c83a6c3ea955b155067c36c4a2c4'

* commit '31aa5335c390c83a6c3ea955b155067c36c4a2c4':
  libopenh264enc: Fix inconsistent whitespace

Merged-by: Hendrik Leppkes 

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

 libavcodec/libopenh264enc.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 07af31d..14afe90 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -163,8 +163,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
 param.sSpatialLayers[0].iSpatialBitrate = param.iTargetBitrate;
 param.sSpatialLayers[0].iMaxSpatialBitrate  = param.iMaxBitrate;
 
-if ((avctx->slices > 1) && (s->max_nal_size)){
-av_log(avctx,AV_LOG_ERROR,"Invalid combination -slices %d and 
-max_nal_size %d.\n",avctx->slices,s->max_nal_size);
+if ((avctx->slices > 1) && (s->max_nal_size)) {
+av_log(avctx, AV_LOG_ERROR,
+   "Invalid combination -slices %d and -max_nal_size %d.\n",
+   avctx->slices, s->max_nal_size);
 goto fail;
 }
 


==


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


[FFmpeg-cvslog] libopenh264enc: Fix inconsistent whitespace

2016-10-07 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Fri Jun 24 
01:06:12 2016 +0300| [31aa5335c390c83a6c3ea955b155067c36c4a2c4] | committer: 
Martin Storsjö

libopenh264enc: Fix inconsistent whitespace

Signed-off-by: Martin Storsjö 

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

 libavcodec/libopenh264enc.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index daab41f..01cb6fb 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -184,8 +184,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
 param.sSpatialLayers[0].iSpatialBitrate = param.iTargetBitrate;
 param.sSpatialLayers[0].iMaxSpatialBitrate  = param.iMaxBitrate;
 
-if ((avctx->slices > 1) && (s->max_nal_size)){
-av_log(avctx,AV_LOG_ERROR,"Invalid combination -slices %d and 
-max_nal_size %d.\n",avctx->slices,s->max_nal_size);
+if ((avctx->slices > 1) && (s->max_nal_size)) {
+av_log(avctx, AV_LOG_ERROR,
+   "Invalid combination -slices %d and -max_nal_size %d.\n",
+   avctx->slices, s->max_nal_size);
 goto fail;
 }
 

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


[FFmpeg-cvslog] omx: Don't return > 0 from omx_encode_frame

2016-10-07 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Fri Jun 24 
01:13:16 2016 +0300| [0c9c4004ed57de210b4d83c7b39bbfb00b86b9af] | committer: 
Martin Storsjö

omx: Don't return > 0 from omx_encode_frame

The encode function is supposed to just return 0 on success.
This stems from a mixup with the return value of decode functions.

Signed-off-by: Martin Storsjö 

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

 libavcodec/omx.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 63c7f5b..0c61c2f 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -845,7 +845,6 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 s->output_buf_size = 0;
 }
 if (buffer->nFlags & OMX_BUFFERFLAG_ENDOFFRAME) {
-ret = pkt->size;
 pkt->pts = av_rescale_q(from_omx_ticks(buffer->nTimeStamp), 
AV_TIME_BASE_Q, avctx->time_base);
 // We don't currently enable B-frames for the encoders, so set
 // pkt->dts = pkt->pts. (The calling code behaves worse if the 
encoder

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


[FFmpeg-cvslog] Merge commit '0c9c4004ed57de210b4d83c7b39bbfb00b86b9af'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:28:53 2016 +0200| [85146dfc23d39caf0167158cee2b6786a2616fff] | committer: 
Hendrik Leppkes

Merge commit '0c9c4004ed57de210b4d83c7b39bbfb00b86b9af'

* commit '0c9c4004ed57de210b4d83c7b39bbfb00b86b9af':
  omx: Don't return > 0 from omx_encode_frame

Merged-by: Hendrik Leppkes 

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



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


[FFmpeg-cvslog] Merge commit '5b63b15663d31f50ce45d980b904a68795ad3f7a'

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
13:29:11 2016 +0200| [adfcf16f76de675f1dd313bc64ec52f2e143732b] | committer: 
Hendrik Leppkes

Merge commit '5b63b15663d31f50ce45d980b904a68795ad3f7a'

* commit '5b63b15663d31f50ce45d980b904a68795ad3f7a':
  lavfi: set the link hwframes context before configuring the dst input

Merged-by: Hendrik Leppkes 

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

 libavfilter/avfilter.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index b236535..1d469c3 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -316,14 +316,6 @@ int avfilter_config_links(AVFilterContext *filter)
 link->time_base = (AVRational) {1, link->sample_rate};
 }
 
-if ((config_link = link->dstpad->config_props))
-if ((ret = config_link(link)) < 0) {
-av_log(link->dst, AV_LOG_ERROR,
-   "Failed to configure input pad on %s\n",
-   link->dst->name);
-return ret;
-}
-
 if (link->src->nb_inputs && link->src->inputs[0]->hw_frames_ctx &&
 !link->hw_frames_ctx) {
 AVHWFramesContext *input_ctx = 
(AVHWFramesContext*)link->src->inputs[0]->hw_frames_ctx->data;
@@ -335,6 +327,14 @@ int avfilter_config_links(AVFilterContext *filter)
 }
 }
 
+if ((config_link = link->dstpad->config_props))
+if ((ret = config_link(link)) < 0) {
+av_log(link->dst, AV_LOG_ERROR,
+   "Failed to configure input pad on %s\n",
+   link->dst->name);
+return ret;
+}
+
 link->init_state = AVLINK_INIT;
 }
 }


==

diff --cc libavfilter/avfilter.c
index b236535,1cedb15..1d469c3
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@@ -304,26 -209,8 +304,18 @@@ int avfilter_config_links(AVFilterConte
 "width and height\n");
  return AVERROR(EINVAL);
  }
 +break;
 +
 +case AVMEDIA_TYPE_AUDIO:
 +if (inlink) {
 +if (!link->time_base.num && !link->time_base.den)
 +link->time_base = inlink->time_base;
 +}
 +
 +if (!link->time_base.num && !link->time_base.den)
 +link->time_base = (AVRational) {1, link->sample_rate};
  }
  
- if ((config_link = link->dstpad->config_props))
- if ((ret = config_link(link)) < 0) {
- av_log(link->dst, AV_LOG_ERROR,
-"Failed to configure input pad on %s\n",
-link->dst->name);
- return ret;
- }
- 
  if (link->src->nb_inputs && link->src->inputs[0]->hw_frames_ctx &&
  !link->hw_frames_ctx) {
  AVHWFramesContext *input_ctx = 
(AVHWFramesContext*)link->src->inputs[0]->hw_frames_ctx->data;

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


[FFmpeg-cvslog] lavfi: set the link hwframes context before configuring the dst input

2016-10-07 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Jun 21 
19:39:51 2016 +0200| [5b63b15663d31f50ce45d980b904a68795ad3f7a] | committer: 
Anton Khirnov

lavfi: set the link hwframes context before configuring the dst input

The destination filter might expect the hw frames context to be already
set (this is the case e.g. for hwdownload).

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

 libavfilter/avfilter.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 190d8ab..1cedb15 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -211,14 +211,6 @@ int avfilter_config_links(AVFilterContext *filter)
 }
 }
 
-if ((config_link = link->dstpad->config_props))
-if ((ret = config_link(link)) < 0) {
-av_log(link->dst, AV_LOG_ERROR,
-   "Failed to configure input pad on %s\n",
-   link->dst->name);
-return ret;
-}
-
 if (link->src->nb_inputs && link->src->inputs[0]->hw_frames_ctx &&
 !link->hw_frames_ctx) {
 AVHWFramesContext *input_ctx = 
(AVHWFramesContext*)link->src->inputs[0]->hw_frames_ctx->data;
@@ -230,6 +222,14 @@ int avfilter_config_links(AVFilterContext *filter)
 }
 }
 
+if ((config_link = link->dstpad->config_props))
+if ((ret = config_link(link)) < 0) {
+av_log(link->dst, AV_LOG_ERROR,
+   "Failed to configure input pad on %s\n",
+   link->dst->name);
+return ret;
+}
+
 link->init_state = AVLINK_INIT;
 }
 }

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


[FFmpeg-cvslog] avconv: explicitly postpone writing the header until all streams are initialized

2016-10-07 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon May 23 
09:19:25 2016 +0200| [1c169782cae6c5c430ff62e7d7272dc9d0e8d527] | committer: 
Anton Khirnov

avconv: explicitly postpone writing the header until all streams are initialized

This should have no practical effect for now, but will make a difference
in the following commits.

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

 avconv.c | 97 +---
 avconv.h |  8 ++
 2 files changed, 71 insertions(+), 34 deletions(-)

diff --git a/avconv.c b/avconv.c
index bd84d9b..6c100ff 100644
--- a/avconv.c
+++ b/avconv.c
@@ -87,7 +87,7 @@ static FILE *vstats_file;
 
 static int nb_frames_drop = 0;
 
-
+static int want_sdp = 1;
 
 #if HAVE_PTHREADS
 /* signal to input threads that they should exit; set by the main thread */
@@ -1487,8 +1487,14 @@ static void print_sdp(void)
 {
 char sdp[16384];
 int i;
-AVFormatContext **avc = av_malloc(sizeof(*avc) * nb_output_files);
+AVFormatContext **avc;
 
+for (i = 0; i < nb_output_files; i++) {
+if (!output_files[i]->header_written)
+return;
+}
+
+avc = av_malloc(sizeof(*avc) * nb_output_files);
 if (!avc)
 exit_program(1);
 for (i = 0; i < nb_output_files; i++)
@@ -1618,6 +1624,42 @@ static InputStream *get_input_stream(OutputStream *ost)
 return NULL;
 }
 
+/* open the muxer when all the streams are initialized */
+static int check_init_output_file(OutputFile *of, int file_index)
+{
+int ret, i;
+
+for (i = 0; i < of->ctx->nb_streams; i++) {
+OutputStream *ost = output_streams[of->ost_index + i];
+if (!ost->initialized)
+return 0;
+}
+
+of->ctx->interrupt_callback = int_cb;
+
+ret = avformat_write_header(of->ctx, &of->opts);
+if (ret < 0) {
+char errbuf[128];
+
+av_strerror(ret, errbuf, sizeof(errbuf));
+
+av_log(NULL, AV_LOG_ERROR,
+   "Could not write header for output file #%d "
+   "(incorrect codec parameters ?): %s",
+   file_index, errbuf);
+return ret;
+}
+assert_avoptions(of->opts);
+of->header_written = 1;
+
+av_dump_format(of->ctx, file_index, of->ctx->filename, 1);
+
+if (want_sdp)
+print_sdp();
+
+return 0;
+}
+
 static int init_output_bsfs(OutputStream *ost)
 {
 AVBSFContext *ctx;
@@ -1860,6 +1902,12 @@ static int init_output_stream(OutputStream *ost, char 
*error, int error_len)
 if (ret < 0)
 return ret;
 
+ost->initialized = 1;
+
+ret = check_init_output_file(output_files[ost->file_index], 
ost->file_index);
+if (ret < 0)
+return ret;
+
 return ret;
 }
 
@@ -1929,7 +1977,6 @@ static int transcode_init(void)
 OutputStream *ost;
 InputStream *ist;
 char error[1024];
-int want_sdp = 1;
 
 /* init framerate emulation */
 for (i = 0; i < nb_input_files; i++) {
@@ -2051,33 +2098,7 @@ static int transcode_init(void)
 }
 }
 
-/* open files and write file headers */
-for (i = 0; i < nb_output_files; i++) {
-oc = output_files[i]->ctx;
-oc->interrupt_callback = int_cb;
-if ((ret = avformat_write_header(oc, &output_files[i]->opts)) < 0) {
-char errbuf[128];
-av_strerror(ret, errbuf, sizeof(errbuf));
-snprintf(error, sizeof(error),
- "Could not write header for output file #%d "
- "(incorrect codec parameters ?): %s",
- i, errbuf);
-ret = AVERROR(EINVAL);
-goto dump_format;
-}
-assert_avoptions(output_files[i]->opts);
-if (strcmp(oc->oformat->name, "rtp")) {
-want_sdp = 0;
-}
-}
-
  dump_format:
-/* dump the file output parameters - cannot be done before in case
-   of stream copy */
-for (i = 0; i < nb_output_files; i++) {
-av_dump_format(output_files[i]->ctx, i, 
output_files[i]->ctx->filename, 1);
-}
-
 /* dump the stream mapping */
 av_log(NULL, AV_LOG_INFO, "Stream mapping:\n");
 for (i = 0; i < nb_input_streams; i++) {
@@ -2166,10 +2187,6 @@ static int transcode_init(void)
 return ret;
 }
 
-if (want_sdp) {
-print_sdp();
-}
-
 return 0;
 }
 
@@ -2672,6 +2689,13 @@ static int transcode(void)
 /* write the trailer if needed and close file */
 for (i = 0; i < nb_output_files; i++) {
 os = output_files[i]->ctx;
+if (!output_files[i]->header_written) {
+av_log(NULL, AV_LOG_ERROR,
+   "Nothing was written into output file %d (%s), because "
+   "at least one of its streams received no packets.\n",
+   i, os->filename);
+continue;
+}
 av_write_trailer(os);
 }
 
@@ -2761,7 +2785,7 @@ static int64_t getmaxrss(void)
 
 int main(int argc, char *

[FFmpeg-cvslog] avformat/matroskaenc: Fix () error

2016-10-07 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Oct  7 14:01:20 2016 +0200| [572f16e10041c9af131709f88a53750a4b3db802] | 
committer: Michael Niedermayer

avformat/matroskaenc: Fix () error

Signed-off-by: Michael Niedermayer 

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

 libavformat/matroskaenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 0878cb5..484b5d6 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -316,7 +316,7 @@ static int start_ebml_master_crc32(AVIOContext *pb, 
AVIOContext **dyn_cp, ebml_m
 {
 int ret;
 
-if (ret = avio_open_dyn_buf(dyn_cp) < 0)
+if ((ret = avio_open_dyn_buf(dyn_cp)) < 0)
 return ret;
 
 if (pb->seekable)

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


[FFmpeg-cvslog] ffmpeg: explicitly write headers for files with no streams

2016-10-07 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Oct  7 
15:44:39 2016 +0200| [ab7e83efed9c8fb30777287304c0de3cc614ce57] | committer: 
Hendrik Leppkes

ffmpeg: explicitly write headers for files with no streams

Recent changes to ffmpeg.c tied output file init to stream init, which broke
stream-less files, specifically ffmetadata output.

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

 ffmpeg.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 454e193..49d91be 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3460,6 +3460,16 @@ static int transcode_init(void)
 }
 }
 
+/* write headers for files with no streams */
+for (i = 0; i < nb_output_files; i++) {
+oc = output_files[i]->ctx;
+if (oc->oformat->flags & AVFMT_NOSTREAMS && oc->nb_streams == 0) {
+ret = check_init_output_file(output_files[i], i);
+if (ret < 0)
+goto dump_format;
+}
+}
+
  dump_format:
 /* dump the stream mapping */
 av_log(NULL, AV_LOG_INFO, "Stream mapping:\n");

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


[FFmpeg-cvslog] ffmpeg: Fix bitstream typo

2016-10-07 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Oct  7 16:05:09 2016 +0200| [72061177f38381ff3e365d89e1c99685eaeaed9a] | 
committer: Michael Niedermayer

ffmpeg: Fix bitstream typo

Signed-off-by: Michael Niedermayer 

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

 ffmpeg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg.h b/ffmpeg.h
index dfab101..2a22f43 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -473,7 +473,7 @@ typedef struct OutputStream {
 int stream_copy;
 
 // init_output_stream() has been called for this stream
-// The encoder and the bistream filters have been initialized and the 
stream
+// The encoder and the bitstream filters have been initialized and the 
stream
 // parameters are set in the AVStream.
 int initialized;
 

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


[FFmpeg-cvslog] avformat/matroskaenc: fix Tags master on seekable output if there are tags after the last stream duration

2016-10-07 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Oct  7 02:32:10 
2016 -0300| [c45ba265fcbb57fcacf82f66cb2a2643210308e1] | committer: James Almer

avformat/matroskaenc: fix Tags master on seekable output if there are tags 
after the last stream duration

The dynamic AVIOContext would get closed pointing to the wrong position
in the buffer.
This is a regression since 650e17d88b63b5aca6e0a43483e89e64b0f7d2dd.

Reviewed-by: Dave Rice 
Signed-off-by: James Almer 

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

 libavformat/matroskaenc.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 484b5d6..593ddd1 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -2264,17 +2264,19 @@ static int mkv_write_trailer(AVFormatContext *s)
 end_ebml_master_crc32(pb, &mkv->info_bc, mkv, mkv->info);
 
 // update stream durations
-if (mkv->stream_durations) {
+if (!mkv->is_live && mkv->stream_durations) {
 int i;
+int64_t curr = avio_tell(mkv->tags_bc);
 for (i = 0; i < s->nb_streams; ++i) {
 AVStream *st = s->streams[i];
-double duration_sec = mkv->stream_durations[i] * 
av_q2d(st->time_base);
-char duration_string[20] = "";
 
-av_log(s, AV_LOG_DEBUG, "stream %d end duration = %" PRIu64 
"\n", i,
-   mkv->stream_durations[i]);
+if (mkv->stream_duration_offsets[i] > 0) {
+double duration_sec = mkv->stream_durations[i] * 
av_q2d(st->time_base);
+char duration_string[20] = "";
+
+av_log(s, AV_LOG_DEBUG, "stream %d end duration = %" 
PRIu64 "\n", i,
+   mkv->stream_durations[i]);
 
-if (!mkv->is_live && mkv->stream_duration_offsets[i] > 0) {
 avio_seek(mkv->tags_bc, mkv->stream_duration_offsets[i], 
SEEK_SET);
 
 snprintf(duration_string, 20, "%02d:%02d:%012.9f",
@@ -2284,6 +2286,7 @@ static int mkv_write_trailer(AVFormatContext *s)
 put_ebml_binary(mkv->tags_bc, MATROSKA_ID_TAGSTRING, 
duration_string, 20);
 }
 }
+avio_seek(mkv->tags_bc, curr, SEEK_SET);
 }
 if (mkv->tags.pos && !mkv->is_live) {
 avio_seek(pb, mkv->tags.pos, SEEK_SET);

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