Ticket #7170: programs_mythtranscode_replex_element.c-evaluation-order

File programs_mythtranscode_replex_element.c-evaluation-order, 1.1 KB (added by Erik Hovland <erik@…>, 11 years ago)

Make evaluation order explicit in replex

Line 
1Make sure that any evaluation is determined explicitly.
2
3From: Erik Hovland <erik@hovland.org>
4
5
6---
7
8 mythtv/programs/mythtranscode/replex/element.c |    5 +++--
9 1 files changed, 3 insertions(+), 2 deletions(-)
10
11
12diff --git a/mythtv/programs/mythtranscode/replex/element.c b/mythtv/programs/mythtranscode/replex/element.c
13index 31a64f0..ab6632b 100644
14--- a/mythtv/programs/mythtranscode/replex/element.c
15+++ b/mythtv/programs/mythtranscode/replex/element.c
16@@ -515,13 +515,14 @@ int check_audio_header(ringbuffer *rbuf, audio_frame_t * af, long  off, int le,
17                                return -1;
18                        }
19                }
20-                if ( af->bit_rate !=
21-                     (  af->bit_rate = bitrates[af->lsf][af->layer-1][(headr[2] >> 4 )]*1000)){
22+                uint32_t tmp_bit_rate = bitrates[af->lsf][af->layer-1][(headr[2] >> 4 )]*1000;
23+                if ( af->bit_rate != tmp_bit_rate ) {
24 #ifdef IN_DEBUG
25                         fprintf(stderr,"Wrong audio bit rate\n");
26 #endif
27                         return -1;
28                 }
29+                af->bit_rate = tmp_bit_rate;
30 
31                 if (af->padding != ((headr[2] >> 1) & 1)){
32                        int fsize;