History

lavc: ensure extended_data is set properly on decoding

Anton Khirnov committed 14 years ago

Commit b437cec1 parent 2bc0de31 file · +14 −0Browse files

Unified · Split

libavcodec/utils.c+14−0
@@ -1291,6 +1291,10 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi · 1290 unmodified lines
1291 } else1291 } else
1292 ret = 0;1292 ret = 0;
1293 1293
1294 /* many decoders assign whole AVFrames, thus overwriting extended_data;
1295 * make sure it's set correctly */
1296 picture->extended_data = picture->data;
1297
1294 return ret;1298 return ret;
1295}1299}
1296 1300
@@ -1347,6 +1351,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, · 50 unmodified lines
1347 int *got_frame_ptr,1351 int *got_frame_ptr,
1348 AVPacket *avpkt)1352 AVPacket *avpkt)
1349{1353{
1354 int planar, channels;
1350 int ret = 0;1355 int ret = 0;
1351 1356
1352 *got_frame_ptr = 0;1357 *got_frame_ptr = 0;
@@ -1369,6 +1374,15 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, · 16 unmodified lines
1369 frame->format = avctx->sample_fmt;1374 frame->format = avctx->sample_fmt;
1370 }1375 }
1371 }1376 }
1377
1378 /* many decoders assign whole AVFrames, thus overwriting extended_data;
1379 * make sure it's set correctly; assume decoders that actually use
1380 * extended_data are doing it correctly */
1381 planar = av_sample_fmt_is_planar(frame->format);
1382 channels = av_get_channel_layout_nb_channels(frame->channel_layout);
1383 if (!(planar && channels > AV_NUM_DATA_POINTERS))
1384 frame->extended_data = frame->data;
1385
1372 return ret;1386 return ret;
1373}1387}
1374 1388

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t