[FFmpeg-cvslog] Merge commit '24b5cff01bbac4e08acfd6d19c499e880988f520'
Hendrik Leppkes
git at videolan.org
Sun Jun 26 20:23:54 CEST 2016
ffmpeg | branch: release/3.1 | Hendrik Leppkes <h.leppkes at gmail.com> | Sun Jun 26 15:18:56 2016 +0200| [2c1d0f871f6a3ee851f7094cc9946652ba1788ab] | committer: Hendrik Leppkes
Merge commit '24b5cff01bbac4e08acfd6d19c499e880988f520'
* commit '24b5cff01bbac4e08acfd6d19c499e880988f520':
lavc: handle hw_frames_ctx where necessary
Merged-by: Hendrik Leppkes <h.leppkes at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c1d0f871f6a3ee851f7094cc9946652ba1788ab
---
libavcodec/options.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 10dc055..d8e3dbf 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -233,6 +233,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
dest->inter_matrix = NULL;
dest->rc_override = NULL;
dest->subtitle_header = NULL;
+ dest->hw_frames_ctx = NULL;
#define alloc_and_copy_or_fail(obj, size, pad) \
if (src->obj && size > 0) { \
@@ -253,14 +254,21 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_assert0(dest->subtitle_header_size == src->subtitle_header_size);
#undef alloc_and_copy_or_fail
+ if (src->hw_frames_ctx) {
+ dest->hw_frames_ctx = av_buffer_ref(src->hw_frames_ctx);
+ if (!dest->hw_frames_ctx)
+ goto fail;
+ }
+
return 0;
fail:
+ av_freep(&dest->subtitle_header);
av_freep(&dest->rc_override);
av_freep(&dest->intra_matrix);
av_freep(&dest->inter_matrix);
av_freep(&dest->extradata);
- av_freep(&dest->subtitle_header);
+ av_buffer_unref(&dest->hw_frames_ctx);
dest->subtitle_header_size = 0;
dest->extradata_size = 0;
av_opt_free(dest);
======================================================================
diff --cc libavcodec/options.c
index 10dc055,18613ac..d8e3dbf
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@@ -233,6 -190,17 +233,7 @@@ FF_ENABLE_DEPRECATION_WARNING
dest->inter_matrix = NULL;
dest->rc_override = NULL;
dest->subtitle_header = NULL;
+ dest->hw_frames_ctx = NULL;
-#if FF_API_MPV_OPT
- FF_DISABLE_DEPRECATION_WARNINGS
- dest->rc_eq = NULL;
- if (src->rc_eq) {
- dest->rc_eq = av_strdup(src->rc_eq);
- if (!dest->rc_eq)
- return AVERROR(ENOMEM);
- }
- FF_ENABLE_DEPRECATION_WARNINGS
-#endif
#define alloc_and_copy_or_fail(obj, size, pad) \
if (src->obj && size > 0) { \
@@@ -249,10 -216,16 +250,16 @@@
alloc_and_copy_or_fail(intra_matrix, 64 * sizeof(int16_t), 0);
alloc_and_copy_or_fail(inter_matrix, 64 * sizeof(int16_t), 0);
alloc_and_copy_or_fail(rc_override, src->rc_override_count * sizeof(*src->rc_override), 0);
- alloc_and_copy_or_fail(subtitle_header, src->subtitle_header_size, 0);
- dest->subtitle_header_size = src->subtitle_header_size;
+ alloc_and_copy_or_fail(subtitle_header, src->subtitle_header_size, 1);
+ av_assert0(dest->subtitle_header_size == src->subtitle_header_size);
#undef alloc_and_copy_or_fail
+ if (src->hw_frames_ctx) {
+ dest->hw_frames_ctx = av_buffer_ref(src->hw_frames_ctx);
+ if (!dest->hw_frames_ctx)
+ goto fail;
+ }
+
return 0;
fail:
@@@ -260,10 -234,12 +268,10 @@@
av_freep(&dest->intra_matrix);
av_freep(&dest->inter_matrix);
av_freep(&dest->extradata);
- av_freep(&dest->subtitle_header);
+ av_buffer_unref(&dest->hw_frames_ctx);
-#if FF_API_MPV_OPT
- FF_DISABLE_DEPRECATION_WARNINGS
- av_freep(&dest->rc_eq);
- FF_ENABLE_DEPRECATION_WARNINGS
-#endif
+ dest->subtitle_header_size = 0;
+ dest->extradata_size = 0;
+ av_opt_free(dest);
return AVERROR(ENOMEM);
}
#endif
More information about the ffmpeg-cvslog
mailing list