mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
avviddec: Fix how we get back the codec frame
With the new copy_opaque system, the corresponding frame is stored in the picture opaque ref. This also handles the case where the "regular" opaque might be empty in the case of "DECODE_ONLY" frames, since it that field is set in `get_buffer2()` which might not be called for those frames Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6301>
This commit is contained in:
parent
eacd5c1cb1
commit
086ecb008f
1 changed files with 11 additions and 2 deletions
|
@ -1881,11 +1881,20 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec,
|
|||
|
||||
/* get the output picture timing info again */
|
||||
out_dframe = ffmpegdec->picture->opaque;
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT (60, 31, 100)
|
||||
out_frame =
|
||||
gst_video_codec_frame_ref (av_buffer_get_opaque (ffmpegdec->
|
||||
picture->opaque_ref));
|
||||
#else
|
||||
g_assert (out_dframe);
|
||||
out_frame = gst_video_codec_frame_ref (out_dframe->frame);
|
||||
#endif
|
||||
|
||||
/* also give back a buffer allocated by the frame, if any */
|
||||
if (out_dframe) {
|
||||
gst_buffer_replace (&out_frame->output_buffer, out_dframe->buffer);
|
||||
gst_buffer_replace (&out_dframe->buffer, NULL);
|
||||
}
|
||||
|
||||
/* Extract auxilliary info not stored in the main AVframe */
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue