aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-08 20:55:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-08 20:55:11 +0200
commit5d6a40bc747da93bd4ee41a446c35fc60a399671 (patch)
tree613c91012a37b3646f1575955d6124ffc4fdefe7 /libavcodec
parent4f043c8a119101ffe8f6a57b18a47f602a350c30 (diff)
parent9294f538e924dcb8f3938e4e3476340f1e5b552f (diff)
downloadffmpeg-5d6a40bc747da93bd4ee41a446c35fc60a399671.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtsp: Don't use av_malloc(0) if there are no streams rtsp: Don't use uninitialized data if there are no streams vaapi: mpeg2: fix slice_vertical_position calculation. hwaccel: mpeg2: decode first field, if requested. cosmetics: Fix indentation rtsp: Don't expose the MS-RTSP RTX data stream to the caller Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg12.c6
-rw-r--r--libavcodec/vaapi_mpeg2.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index d81fa9dd0f..ea19b819cc 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1635,6 +1635,12 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
return -1;
}
+ if (s->avctx->hwaccel &&
+ (s->avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
+ if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
+ av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode first field\n");
+ }
+
for (i = 0; i < 4; i++) {
s->current_picture.f.data[i] = s->current_picture_ptr->f.data[i];
if (s->picture_structure == PICT_BOTTOM_FIELD) {
diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
index 030f76bfb9..e6ff764f61 100644
--- a/libavcodec/vaapi_mpeg2.c
+++ b/libavcodec/vaapi_mpeg2.c
@@ -132,7 +132,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
return -1;
slice_param->macroblock_offset = macroblock_offset;
slice_param->slice_horizontal_position = s->mb_x;
- slice_param->slice_vertical_position = s->mb_y;
+ slice_param->slice_vertical_position = s->mb_y >> (s->picture_structure != PICT_FRAME);
slice_param->quantiser_scale_code = quantiser_scale_code;
slice_param->intra_slice_flag = intra_slice_flag;
return 0;