diff mbox

[FFmpeg-devel] lavc/qsv: remove vaapi device free function

Message ID 1570510501-12349-1-git-send-email-zhong.li@intel.com
State Accepted
Commit 949a1b3e2f75338e17e446e97105e06ad6b4012a
Headers show

Commit Message

Zhong Li Oct. 8, 2019, 4:55 a.m. UTC
It is not needed since av_buffer_unref() will call it internally

Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsv.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Fu, Linjie Oct. 9, 2019, 2:49 a.m. UTC | #1
> -----Original Message-----

> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of

> Zhong Li

> Sent: Tuesday, October 8, 2019 12:55

> To: ffmpeg-devel@ffmpeg.org

> Cc: Li, Zhong <zhong.li@intel.com>

> Subject: [FFmpeg-devel] [PATCH] lavc/qsv: remove vaapi device free

> function

> 

> It is not needed since av_buffer_unref() will call it internally

> 

> Signed-off-by: Zhong Li <zhong.li@intel.com>

> ---

>  libavcodec/qsv.c | 4 ----

>  1 file changed, 4 deletions(-)

> 

> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c

> index a43f0d5..81fa4a8 100644

> --- a/libavcodec/qsv.c

> +++ b/libavcodec/qsv.c

> @@ -835,10 +835,6 @@ int ff_qsv_close_internal_session(QSVSession *qs)

>          qs->session = NULL;

>      }

>  #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE

> -    if (qs->va_device_ctx) {

> -        qs->va_device_ctx->free(qs->va_device_ctx);

> -    }

> -

>      av_buffer_unref(&qs->va_device_ref);

>  #endif

>      return 0;

> --

> 2.7.4


LGTM.
Also addressed some unexpected crashes when "vframes" is set.

- linjie
Zhong Li Oct. 9, 2019, 3:29 a.m. UTC | #2
> From: Fu, Linjie <linjie.fu@intel.com>

> Sent: Wednesday, October 9, 2019 10:49 AM

> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>

> Cc: Li, Zhong <zhong.li@intel.com>

> Subject: RE: [FFmpeg-devel] [PATCH] lavc/qsv: remove vaapi device free function

> 

> > -----Original Message-----

> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of

> > Zhong Li

> > Sent: Tuesday, October 8, 2019 12:55

> > To: ffmpeg-devel@ffmpeg.org

> > Cc: Li, Zhong <zhong.li@intel.com>

> > Subject: [FFmpeg-devel] [PATCH] lavc/qsv: remove vaapi device free

> > function

> >

> > It is not needed since av_buffer_unref() will call it internally

> >

> > Signed-off-by: Zhong Li <zhong.li@intel.com>

> > ---

> >  libavcodec/qsv.c | 4 ----

> >  1 file changed, 4 deletions(-)

> >

> > diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index

> > a43f0d5..81fa4a8 100644

> > --- a/libavcodec/qsv.c

> > +++ b/libavcodec/qsv.c

> > @@ -835,10 +835,6 @@ int ff_qsv_close_internal_session(QSVSession *qs)

> >          qs->session = NULL;

> >      }

> >  #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE

> > -    if (qs->va_device_ctx) {

> > -        qs->va_device_ctx->free(qs->va_device_ctx);

> > -    }

> > -

> >      av_buffer_unref(&qs->va_device_ref);

> >  #endif

> >      return 0;

> > --

> > 2.7.4

> 

> LGTM.

> Also addressed some unexpected crashes when "vframes" is set.


Applied, thanks.
diff mbox

Patch

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index a43f0d5..81fa4a8 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -835,10 +835,6 @@  int ff_qsv_close_internal_session(QSVSession *qs)
         qs->session = NULL;
     }
 #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
-    if (qs->va_device_ctx) {
-        qs->va_device_ctx->free(qs->va_device_ctx);
-    }
-
     av_buffer_unref(&qs->va_device_ref);
 #endif
     return 0;