Browse code

h264: Use mismatching frame numbers in fields

to synchronize the first/second field state independant of them being reference or not.
Fixes Ticket354

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 545ec935a4b4e0f032ebd975907b41f6fe4465c9)

Michael Niedermayer authored on 2011/11/13 05:10:15
Showing 1 changed files
... ...
@@ -2810,11 +2810,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2810 2810
                 s0->first_field = FIELD_PICTURE;
2811 2811
 
2812 2812
             } else {
2813
-                if (h->nal_ref_idc &&
2814
-                        s0->current_picture_ptr->reference &&
2815
-                        s0->current_picture_ptr->frame_num != h->frame_num) {
2813
+                if (s0->current_picture_ptr->frame_num != h->frame_num) {
2816 2814
                     /*
2817
-                     * This and previous field were reference, but had
2815
+                     * This and previous field had
2818 2816
                      * different frame_nums. Consider this field first in
2819 2817
                      * pair. Throw away previous field except for reference
2820 2818
                      * purposes.