Re: [FFmpeg-devel] [PATCH] h264: Move AFD to side data to match MPEG-2

2014-08-22 Thread Christophe Gisquet
Hi,

2014-08-22 1:21 GMT+02:00 Christophe Gisquet :
> Maybe all that side data stuff should be moved to the end of the
> function first (but before the last thread-related line), and fixed,
> then you also add this hunk there?

Not a good thing to do either, after discussing with Michael. I'll
send a patch to change what is there at the moment, and you can model
your change from it.

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


Re: [FFmpeg-devel] [PATCH] h264: Move AFD to side data to match MPEG-2

2014-08-21 Thread Christophe Gisquet
Hi,

2014-08-09 2:45 GMT+02:00 Kieran Kunhya :
> +AVFrameSideData *sd =
> +av_frame_new_side_data(&cur->f,
> +   AV_FRAME_DATA_AFD, 1);
> +if (!sd)
> +return;

You're not responsible for what has already been committed before, but:
1) The allocation failure is detected but not returned to the caller;
2) It leaves objects in a kind of undetermined state by exiting early
the function.

Maybe all that side data stuff should be moved to the end of the
function first (but before the last thread-related line), and fixed,
then you also add this hunk there?

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


Re: [FFmpeg-devel] [PATCH] h264: Move AFD to side data to match MPEG-2

2014-08-21 Thread Kieran Kunhya
On 9 August 2014 01:45, Kieran Kunhya  wrote:
> ---
>  libavcodec/h264.c |   11 +++
>  libavcodec/h264.h |6 ++
>  libavcodec/h264_sei.c |6 ++
>  3 files changed, 23 insertions(+)

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


[FFmpeg-devel] [PATCH] h264: Move AFD to side data to match MPEG-2

2014-08-08 Thread Kieran Kunhya
---
 libavcodec/h264.c |   11 +++
 libavcodec/h264.h |6 ++
 libavcodec/h264_sei.c |6 ++
 3 files changed, 23 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8fa35c7..e77b633 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -883,6 +883,17 @@ static void decode_postinit(H264Context *h, int 
setup_finished)
h->sei_vflip, h->sei_hflip);
 }
 
+if (h->afd_present) {
+AVFrameSideData *sd =
+av_frame_new_side_data(&cur->f,
+   AV_FRAME_DATA_AFD, 1);
+if (!sd)
+return;
+
+*sd->data   = h->afd;
+h->afd_present = 0;
+}
+
 cur->mmco_reset = h->mmco_reset;
 h->mmco_reset = 0;
 
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 5ec4f0c..b7e7b04 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -682,6 +682,12 @@ typedef struct H264Context {
 int sei_hflip, sei_vflip;
 
 /**
+ * AFD
+ */
+int afd_present;
+uint8_t afd;
+
+/**
  * Bit set of clock types for fields/frames in picture timing SEI message.
  * For each found ct_type, appropriate bit is set (e.g., bit 1 for
  * interlaced).
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index aa889b8..2d0212d 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -132,7 +132,13 @@ static int decode_user_data_itu_t_t35(H264Context *h, int 
size)
 return -1;
 skip_bits(&h->gb, 4);
 dtg_active_format = get_bits(&h->gb, 4);
+#if FF_API_AFD
+FF_DISABLE_DEPRECATION_WARNINGS
 h->avctx->dtg_active_format = dtg_active_format;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif /* FF_API_AFD */
+h->afd_present = 1;
+h->afd = dtg_active_format;
 } else {
 skip_bits(&h->gb, 6);
 }
-- 
1.7.9.5

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