From c22576e0ac10e48fc5ab3dc41c92d5fe8aa5f8b8 Mon Sep 17 00:00:00 2001
From: michael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Date: Tue, 24 Feb 2009 18:51:16 +0000
Subject: [PATCH] ff_find_hwaccel()

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17568 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
---
 libavcodec/utils.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index cd4cbde37..b6412a531 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1140,3 +1140,15 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel)
 {
     return hwaccel ? hwaccel->next : first_hwaccel;
 }
+
+AVHWAccel *ff_find_hwaccel(enum CodecID codec_id, enum PixelFormat pix_fmt)
+{
+    AVHWAccel *hwaccel=NULL;
+
+    while((hwaccel= av_hwaccel_next(hwaccel))){
+        if (   hwaccel->id      == codec_id
+            && hwaccel->pix_fmt == pix_fmt)
+            return hwaccel;
+    }
+    return NULL;
+}
-- 
2.25.4