summaryrefslogtreecommitdiffstats
path: root/recipes/ffmpeg/omapfbplay/0001-Remove-pointless-function-frame_format.patch
blob: 07357c99078166961e1fb48168803a4b2b335f63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 27e9c12063427e6d1c245d9ce594916966764750 Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Wed, 26 Jan 2011 18:34:26 +0000
Subject: [PATCH 1/3] Remove pointless function frame_format()

Decoders are required to fill in the frame format.
---
 omapfbplay.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/omapfbplay.c b/omapfbplay.c
index 3409780..2daed18 100644
--- a/omapfbplay.c
+++ b/omapfbplay.c
@@ -300,17 +300,6 @@ void ofbp_post_frame(struct frame *f)
 }
 
 static void
-frame_format(int width, int height, struct frame_format *ff)
-{
-    ff->width  = ALIGN(width,  32);
-    ff->height = ALIGN(height, 32);
-    ff->disp_x = 0;
-    ff->disp_y = 0;
-    ff->disp_w = width;
-    ff->disp_h = height;
-}
-
-static void
 init_frames(struct frame_format *ff)
 {
     const struct pixfmt *pf = ofbp_get_pixfmt(ff->pixfmt);
@@ -445,7 +434,12 @@ speed_test(const char *drv, const char *mem, const char *conv,
         return 1;
     }
 
-    frame_format(w, h, &ff);
+    ff.width  = ALIGN(w, 32);
+    ff.height = ALIGN(h, 32);
+    ff.disp_x = 0;
+    ff.disp_y = 0;
+    ff.disp_w = w;
+    ff.disp_h = h;
 
     dp.pixfmt = ff.pixfmt = PIX_FMT_YUV420P;
     display = display_open(drv, &dp, &ff);
@@ -599,8 +593,8 @@ main(int argc, char **argv)
     }
 
     if (!frame_fmt.width) {
-        frame_fmt.pixfmt = st->codec->pix_fmt;
-        frame_format(st->codec->width, st->codec->height, &frame_fmt);
+        fprintf(stderr, "Decoder error: frame size not specified\n");
+        error(1);
     }
 
     dp.pixfmt = frame_fmt.pixfmt;
-- 
1.6.6.1