Revision 1c2a8c7f

View differences:

libavcodec/avcodec.h
5 5

  
6 6
#define LIBAVCODEC_VERSION_INT 0x000406
7 7
#define LIBAVCODEC_VERSION     "0.4.6"
8
#define LIBAVCODEC_BUILD       4602
9
#define LIBAVCODEC_BUILD_STR   "4602"
8
#define LIBAVCODEC_BUILD       4603
9
#define LIBAVCODEC_BUILD_STR   "4603"
10 10

  
11 11
enum CodecID {
12 12
    CODEC_ID_NONE, 
......
340 340

  
341 341
void avcodec_register_all(void);
342 342

  
343
void avcodec_flush_buffers(AVCodecContext *avctx);
344

  
343 345
#ifdef FF_POSTPROCESS
344 346
#ifndef MBC
345 347
#define MBC 128
libavcodec/h263.c
1034 1034

  
1035 1035
    if(s->low_delay){
1036 1036
        put_bits(&s->pb, 1, 1);		/* vol control parameters= yes */
1037
        put_bits(&s->pb, 2, 1);		/* chroma format 422 */
1037
        put_bits(&s->pb, 2, 1);		/* chroma format YUV 420/YV12 */
1038 1038
        put_bits(&s->pb, 1, s->low_delay);
1039 1039
        put_bits(&s->pb, 1, 0);		/* vbv parameters= no */
1040 1040
    }else{
......
2602 2602
        } else {
2603 2603
            vo_ver_id = 1;
2604 2604
        }
2605
        
2605
//printf("vo type:%d\n",s->vo_type);
2606 2606
        s->aspect_ratio_info= get_bits(&s->gb, 4);
2607 2607
	if(s->aspect_ratio_info == EXTENDET_PAR){
2608 2608
            skip_bits(&s->gb, 8); //par_width
libavcodec/h263dec.c
135 135
    } else {
136 136
        ret = h263_decode_picture_header(s);
137 137
    }
138
    if(ret==FRAME_SKIPED) return 0;
139 138

  
140 139
        /* After H263 & mpeg4 header decode we have the height, width,*/
141 140
        /* and other parameters. So then we could init the picture   */
......
154 153
            return -1;
155 154
    }
156 155

  
156
    if(ret==FRAME_SKIPED) return 0;
157 157
    if (ret < 0)
158 158
        return -1;
159

  
159
    /* skip b frames if we dont have reference frames */
160
    if(s->num_available_buffers<2 && s->pict_type==B_TYPE) return 0;
161
        
160 162
    MPV_frame_start(s);
161 163

  
162 164
#ifdef DEBUG
......
222 224
            }
223 225
            MPV_decode_mb(s, s->block);
224 226
        }
225
        if (avctx->draw_horiz_band) {
227
        if (    avctx->draw_horiz_band 
228
            && (s->num_available_buffers>=1 || (!s->has_b_frames)) ) {
226 229
            UINT8 *src_ptr[3];
227 230
            int y, h, offset;
228 231
            y = s->mb_y * 16;
......
279 282
    /* we substract 1 because it is added on utils.c    */
280 283
    avctx->frame_number = s->picture_number - 1;
281 284

  
282
    *data_size = sizeof(AVPicture);
285
    /* dont output the last pic after seeking 
286
       note we allready added +1 for the current pix in MPV_frame_end(s) */
287
    if(s->num_available_buffers>=2 || (!s->has_b_frames))
288
        *data_size = sizeof(AVPicture);
289

  
283 290
    return buf_size;
284 291
}
285 292

  
libavcodec/mpegvideo.c
629 629
        s->last_non_b_pict_type= s->pict_type;
630 630
        s->last_non_b_qscale= s->qscale;
631 631
        s->last_non_b_mc_mb_var= s->mc_mb_var;
632
        s->num_available_buffers++;
633
        if(s->num_available_buffers>2) s->num_available_buffers= 2;
632 634
    }
633 635
}
634 636

  
libavcodec/mpegvideo.h
129 129
    UINT8 *aux_picture[3];       /* aux picture (for B frames only) */
130 130
    UINT8 *aux_picture_base[3];  /* real start of the picture */
131 131
    UINT8 *current_picture[3];   /* buffer to store the decompressed current picture */
132
    int num_available_buffers;   /* is 0 at the start & after seeking, after the first I frame its 1 after next I/P 2 */
132 133
    int last_dc[3];              /* last DC values for MPEG1 */
133 134
    INT16 *dc_val[3];            /* used for mpeg4 DC prediction, all 3 arrays must be continuous */
134 135
    int y_dc_scale, c_dc_scale;
libavcodec/utils.c
22 22
#include "common.h"
23 23
#include "dsputil.h"
24 24
#include "avcodec.h"
25
#include "mpegvideo.h"
25 26
#ifdef HAVE_MALLOC_H
26 27
#include <malloc.h>
27 28
#else
......
479 480
#undef PCM_CODEC
480 481
}
481 482

  
483
/* this should be called after seeking and before trying to decode the next frame */
484
void avcodec_flush_buffers(AVCodecContext *avctx)
485
{
486
    MpegEncContext *s = avctx->priv_data;
487
    s->num_available_buffers=0;
488
}
489

  
490

  
482 491
static int encode_init(AVCodecContext *s)
483 492
{
484 493
    return 0;

Also available in: Unified diff