comparison gif.c @ 85:25062c9b1f86 libavformat

per context frame_rate_base, this should finally fix frame_rate related av sync issues
author michaelni
date Wed, 12 Mar 2003 15:16:19 +0000
parents a58a8a53eb46
children 3d92f793fd67
comparison
equal deleted inserted replaced
84:0068a6902911 85:25062c9b1f86
294 static int gif_write_header(AVFormatContext *s) 294 static int gif_write_header(AVFormatContext *s)
295 { 295 {
296 GIFContext *gif = s->priv_data; 296 GIFContext *gif = s->priv_data;
297 ByteIOContext *pb = &s->pb; 297 ByteIOContext *pb = &s->pb;
298 AVCodecContext *enc, *video_enc; 298 AVCodecContext *enc, *video_enc;
299 int i, width, height, rate; 299 int i, width, height/*, rate*/;
300 300
301 /* XXX: do we reject audio streams or just ignore them ? 301 /* XXX: do we reject audio streams or just ignore them ?
302 if(s->nb_streams > 1) 302 if(s->nb_streams > 1)
303 return -1; 303 return -1;
304 */ 304 */
316 av_free(gif); 316 av_free(gif);
317 return -1; 317 return -1;
318 } else { 318 } else {
319 width = video_enc->width; 319 width = video_enc->width;
320 height = video_enc->height; 320 height = video_enc->height;
321 rate = video_enc->frame_rate; 321 // rate = video_enc->frame_rate;
322 } 322 }
323 323
324 /* XXX: is it allowed ? seems to work so far... */ 324 /* XXX: is it allowed ? seems to work so far... */
325 video_enc->pix_fmt = PIX_FMT_RGB24; 325 video_enc->pix_fmt = PIX_FMT_RGB24;
326 326
349 delay = gif->file_time - gif->time; 349 delay = gif->file_time - gif->time;
350 350
351 /* XXX: should use delay, in order to be more accurate */ 351 /* XXX: should use delay, in order to be more accurate */
352 /* instead of using the same rounded value each time */ 352 /* instead of using the same rounded value each time */
353 /* XXX: don't even remember if I really use it for now */ 353 /* XXX: don't even remember if I really use it for now */
354 jiffies = (70*FRAME_RATE_BASE/enc->frame_rate) - 1; 354 jiffies = (70*enc->frame_rate_base/enc->frame_rate) - 1;
355 355
356 put_le16(pb, jiffies); 356 put_le16(pb, jiffies);
357 357
358 put_byte(pb, 0x1f); /* transparent color index */ 358 put_byte(pb, 0x1f); /* transparent color index */
359 put_byte(pb, 0x00); 359 put_byte(pb, 0x00);