On Thu, 4 Oct 2007, Michael Niedermayer wrote: [...]
Content-Description: Patch 6: MMCO [...] case MMCO_LONG: + j = 1; + if (FIELD_PICTURE && !s->first_field) { + if (h->long_ref[mmco[i].long_arg] == s->current_picture_ptr) { + /* Just mark second field as referenced */ + j = 0; + } else if (s->current_picture_ptr->reference) { + /* First field in pair is in short term list or + * at a different long term index. + * This is not allowed; see 7.4.3, notes 2 and 3. + * Report the problem and keep the pair where it is, + * and mark this field valid. + */ + av_log(h->s.avctx, AV_LOG_ERROR, + "illegal long term reference assignment for second " + "field in complementary field pair (first field is " + "short term or has non-matching long index)\n"); + j = 0; + } + } + + if (j) {
please use a better name than j
Used j because it was already defined and unused in this context. Added new var named unref_pic.
[...]
+ } else { + av_log(h->s.avctx, AV_LOG_ERROR, "problem in internal reference " + "list handling; marking second " + "field in pair finds first field " + "in reference, but not in any " + "ref list\n");
if this cannot happen unless our code is buggy te correct behavior is assert(0);
OK. Added the assert, changed the log message to a comment, removed the reference clearing. The block will be a no-op when NDEBUG is defined. Revised patch attached. If ok, I'll follow up with revised indent patch to match prior to application in svn. -Jeff