From: Kostya Shishkov Date: Tue, 6 Aug 2024 16:10:15 +0000 (+0200) Subject: hwdec-vaapi: koda for H.264 X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=36f40ea0837d4da14a7d60c4cea2a3c64e50d6e4;p=nihav-player.git hwdec-vaapi: koda for H.264 --- diff --git a/hwdec-vaapi/src/lib.rs b/hwdec-vaapi/src/lib.rs index cdc8b08..6310eac 100644 --- a/hwdec-vaapi/src/lib.rs +++ b/hwdec-vaapi/src/lib.rs @@ -436,8 +436,8 @@ fn fill_frame(ifmt: VAImageFormat, pic: &Picture, frm: &mut NABuffe match iimg.format.fourcc().map_err(|_| DecoderError::InvalidData)? { VAFourcc::NV12 => { let frm = NASimpleVideoFrame::from_video_buf(&mut vbuf).unwrap(); - validate!(iimg.width == (frm.width[0] as u16)); - validate!(iimg.height == (frm.height[0] as u16)); + validate!(iimg.width == (((frm.width[0] + 15) & !15) as u16)); + validate!(iimg.height == (((frm.height[0] + 15) & !15) as u16)); copy_luma(&mut frm.data[frm.offset[0]..], frm.stride[0], &imgdata[iimg.offsets[0] as usize..], iimg.pitches[0] as usize, frm.width[0], frm.height[0]); @@ -614,7 +614,7 @@ println!("config creation failed!"); self.vaapi = Some(VaapiInternals { display, context, ref_pics, surfaces, ifmt }); - let vinfo = NAVideoInfo::new(width, height, false, YUV420_FORMAT); + let vinfo = NAVideoInfo::new(vinfo.get_width(), vinfo.get_height(), false, YUV420_FORMAT); self.info = NACodecInfo::new_ref(info.get_name(), NACodecTypeInfo::Video(vinfo), info.get_extradata()).into_ref(); self.out_frm = alloc_video_buffer(vinfo, 4)?;