Revision 9296f5d8

View differences:

libavcodec/h264.c
3454 3454
        av_log(h->s.avctx, AV_LOG_DEBUG, "no mmco here\n");
3455 3455

  
3456 3456
    for(i=0; i<mmco_count; i++){
3457
        int structure, frame_num, unref_pic;
3457
        int structure, frame_num;
3458 3458
        if(s->avctx->debug&FF_DEBUG_MMCO)
3459 3459
            av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_pic_num, h->mmco[i].long_arg);
3460 3460

  
......
3498 3498
                av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref long failure\n");
3499 3499
            break;
3500 3500
        case MMCO_LONG:
3501
            unref_pic = 1;
3502
            if (FIELD_PICTURE && !s->first_field) {
3503
                if (h->long_ref[mmco[i].long_arg] == s->current_picture_ptr) {
3504
                    /* Just mark second field as referenced */
3505
                    unref_pic = 0;
3506
                } else if (s->current_picture_ptr->reference) {
3501
                    // Comment below left from previous code as it is an interresting note.
3507 3502
                    /* First field in pair is in short term list or
3508 3503
                     * at a different long term index.
3509 3504
                     * This is not allowed; see 7.4.3, notes 2 and 3.
3510 3505
                     * Report the problem and keep the pair where it is,
3511 3506
                     * and mark this field valid.
3512 3507
                     */
3513
                    av_log(h->s.avctx, AV_LOG_ERROR,
3514
                        "illegal long term reference assignment for second "
3515
                        "field in complementary field pair (first field is "
3516
                        "short term or has non-matching long index)\n");
3517
                    unref_pic = 0;
3518
                }
3519
            }
3520 3508

  
3521
            if (unref_pic) {
3509
            if (h->long_ref[mmco[i].long_arg] != s->current_picture_ptr) {
3522 3510
                pic= remove_long(h, mmco[i].long_arg);
3523 3511
                if(pic) unreference_pic(h, pic, 0);
3524 3512

  

Also available in: Unified diff