Ticket #1926: h264utils.diff
File h264utils.diff, 2.2 KB (added by , 18 years ago) |
---|
-
mythtv/libs/libmythtv/mpeg/h264utils.h
195 195 196 196 bool saw_AU_delimiter; 197 197 bool saw_first_VCL_NAL_unit; 198 bool saw_sps; 198 199 199 200 bool did_evaluate_once; 200 201 bool keyframe; -
mythtv/libs/libmythtv/mpeg/h264utils.cpp
62 62 63 63 saw_AU_delimiter = false; 64 64 saw_first_VCL_NAL_unit = false; 65 saw_sps = false; 65 66 66 67 did_evaluate_once = false; 67 68 keyframe = false; … … 113 114 } 114 115 } 115 116 116 // stage 2: determine if it's an IDR AU 117 if (!saw_first_VCL_NAL_unit && new_NAL_type == NALUnitType::SLICE_IDR) 117 if (!saw_first_VCL_NAL_unit && !saw_sps && new_NAL_type == NALUnitType::SPS) 118 118 { 119 keyframe = true; 119 saw_sps = true; 120 state_changed = true; 121 keyframe = false; 120 122 } 121 123 122 // stage 3: did we see the AU's first VCL NAL unit yet?123 124 if (!saw_first_VCL_NAL_unit && NALUnitType::IsVCLType(new_NAL_type)) 124 125 { 125 126 saw_first_VCL_NAL_unit = true; 126 127 saw_AU_delimiter = false; 128 state_changed = true; 129 if (saw_sps) 130 keyframe = true; 131 saw_sps = false; 127 132 } 128 133 } 129 134 … … 152 157 read_first_NAL_byte = false; 153 158 keyframe = false; 154 159 155 state_changed = true;156 160 return local_bytes - bytes; 157 161 } 158 162 else … … 167 171 local_bytes++; 168 172 } 169 173 } 170 174 state_changed = false; 171 175 if (synced && !read_first_NAL_byte && local_bytes < local_bytes_end) 172 176 { 173 177 KeyframePredicate(*local_bytes); … … 178 182 synced = false; 179 183 read_first_NAL_byte = true; 180 184 181 state_changed = true;182 185 return local_bytes - bytes; 183 186 } 184 187 185 state_changed = false; 188 186 189 return local_bytes - bytes; 187 190 }