Revision e0a3d744 libavcodec/mpeg12.c

View differences:

libavcodec/mpeg12.c
1338 1338
    /* composite display not parsed */
1339 1339
    dprintf("intra_dc_precision=%d\n", s->intra_dc_precision);
1340 1340
    dprintf("picture_structure=%d\n", s->picture_structure);
1341
    dprintf("top field first=%d\n", s->top_field_first);
1342
    dprintf("repeat first field=%d\n", s->repeat_first_field);
1341 1343
    dprintf("conceal=%d\n", s->concealment_motion_vectors);
1342 1344
    dprintf("intra_vlc_format=%d\n", s->intra_vlc_format);
1343 1345
    dprintf("alternate_scan=%d\n", s->alternate_scan);
......
1587 1589

  
1588 1590
    buf_ptr = buf;
1589 1591
    buf_end = buf + buf_size;
1590
    
1591
    if (s->repeat_field % 2 == 1 && avctx->repeat_pict) {
1592

  
1593
#if 0    
1594
    if (s->repeat_field % 2 == 1) { 
1592 1595
        s->repeat_field++;
1593 1596
        //fprintf(stderr,"\nRepeating last frame: %d -> %d! pict: %d %d", avctx->frame_number-1, avctx->frame_number,
1594
        //                                                         s2->picture_number, s->repeat_field);
1595
        *data_size = sizeof(AVPicture);
1596
        goto the_end;
1597
        //        s2->picture_number, s->repeat_field);
1598
        if (avctx->flags & CODEC_FLAG_REPEAT_FIELD) {
1599
            *data_size = sizeof(AVPicture);
1600
            goto the_end;
1601
        }
1597 1602
    }
1598

  
1603
#endif
1599 1604
    while (buf_ptr < buf_end) {
1600 1605
        buf_start = buf_ptr;
1601 1606
        /* find start next code */
......
1645 1650
                        if (ret == 1) {
1646 1651
                            /* got a picture: exit */
1647 1652
                            /* first check if we must repeat the frame */
1653
                            avctx->repeat_pict = 0;
1654
#if 0
1648 1655
                            if (s2->progressive_frame && s2->repeat_first_field) {
1649 1656
                                //fprintf(stderr,"\nRepeat this frame: %d! pict: %d",avctx->frame_number,s2->picture_number);
1650
                                s2->repeat_first_field = 0;
1651
                                s2->progressive_frame = 0;
1657
                                //s2->repeat_first_field = 0;
1658
                                //s2->progressive_frame = 0;
1652 1659
                                if (++s->repeat_field > 2)
1653 1660
                                    s->repeat_field = 0;
1661
                                avctx->repeat_pict = 1;
1654 1662
                            }
1663
#endif                      
1664
                            if (s2->repeat_first_field) {
1665
                                if (s2->progressive_sequence) {
1666
                                    if (s2->top_field_first)
1667
                                        avctx->repeat_pict = 4;
1668
                                    else
1669
                                        avctx->repeat_pict = 2;
1670
                                } else if (s2->progressive_frame) {
1671
                                    avctx->repeat_pict = 1;
1672
                                }
1673
                            }         
1655 1674
                            *data_size = sizeof(AVPicture);
1656 1675
                            goto the_end;
1657 1676
                        }

Also available in: Unified diff