mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-14 16:58:33 +00:00
VC1 VDPAU: Mark missing reference frames as such.
Currently the code passes some nonsense values as references instead, causing corruption with NVidia's and assertion failures with Mesa's implementation. For non-corrupted input this mostly happens in interlaced bitstreams, e.g. http://samples.mplayerhq.hu/V-codecs/WMV9/interlaced/480i30__codec_WVC1__mode_2__framerate_29.970__type_2__preproc_17.wmv. The != VDP_INVALID handle assert does not trigger (and probably is quite nonsense) because the frames are initialized to 0. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
parent
ebb8dd437b
commit
af6e232ccf
1 changed files with 4 additions and 0 deletions
|
@ -44,14 +44,18 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx,
|
||||||
|
|
||||||
switch (s->pict_type) {
|
switch (s->pict_type) {
|
||||||
case AV_PICTURE_TYPE_B:
|
case AV_PICTURE_TYPE_B:
|
||||||
|
if (s->next_picture_ptr) {
|
||||||
ref = ff_vdpau_get_surface_id(&s->next_picture);
|
ref = ff_vdpau_get_surface_id(&s->next_picture);
|
||||||
assert(ref != VDP_INVALID_HANDLE);
|
assert(ref != VDP_INVALID_HANDLE);
|
||||||
info->backward_reference = ref;
|
info->backward_reference = ref;
|
||||||
|
}
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
case AV_PICTURE_TYPE_P:
|
case AV_PICTURE_TYPE_P:
|
||||||
|
if (s->last_picture_ptr) {
|
||||||
ref = ff_vdpau_get_surface_id(&s->last_picture);
|
ref = ff_vdpau_get_surface_id(&s->last_picture);
|
||||||
assert(ref != VDP_INVALID_HANDLE);
|
assert(ref != VDP_INVALID_HANDLE);
|
||||||
info->forward_reference = ref;
|
info->forward_reference = ref;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info->slice_count = 0;
|
info->slice_count = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue