comparison rm.c @ 65:a58a8a53eb46 libavformat

* UINTX -> uintx_t INTX -> intx_t
author kabi
date Tue, 11 Feb 2003 16:35:48 +0000
parents 3eff1f2dcf71
children 25062c9b1f86
comparison
equal deleted inserted replaced
64:b0e0eb595e29 65:a58a8a53eb46
320 rv10_write_header(s, 0, 0); 320 rv10_write_header(s, 0, 0);
321 put_flush_packet(&s->pb); 321 put_flush_packet(&s->pb);
322 return 0; 322 return 0;
323 } 323 }
324 324
325 static int rm_write_audio(AVFormatContext *s, UINT8 *buf, int size) 325 static int rm_write_audio(AVFormatContext *s, uint8_t *buf, int size)
326 { 326 {
327 UINT8 *buf1; 327 uint8_t *buf1;
328 RMContext *rm = s->priv_data; 328 RMContext *rm = s->priv_data;
329 ByteIOContext *pb = &s->pb; 329 ByteIOContext *pb = &s->pb;
330 StreamInfo *stream = rm->audio_stream; 330 StreamInfo *stream = rm->audio_stream;
331 int i; 331 int i;
332 332
333 /* XXX: suppress this malloc */ 333 /* XXX: suppress this malloc */
334 buf1= (UINT8*) av_malloc( size * sizeof(UINT8) ); 334 buf1= (uint8_t*) av_malloc( size * sizeof(uint8_t) );
335 335
336 write_packet_header(s, stream, size, stream->enc->coded_frame->key_frame); 336 write_packet_header(s, stream, size, stream->enc->coded_frame->key_frame);
337 337
338 /* for AC3, the words seems to be reversed */ 338 /* for AC3, the words seems to be reversed */
339 for(i=0;i<size;i+=2) { 339 for(i=0;i<size;i+=2) {
345 stream->nb_frames++; 345 stream->nb_frames++;
346 av_free(buf1); 346 av_free(buf1);
347 return 0; 347 return 0;
348 } 348 }
349 349
350 static int rm_write_video(AVFormatContext *s, UINT8 *buf, int size) 350 static int rm_write_video(AVFormatContext *s, uint8_t *buf, int size)
351 { 351 {
352 RMContext *rm = s->priv_data; 352 RMContext *rm = s->priv_data;
353 ByteIOContext *pb = &s->pb; 353 ByteIOContext *pb = &s->pb;
354 StreamInfo *stream = rm->video_stream; 354 StreamInfo *stream = rm->video_stream;
355 int key_frame = stream->enc->coded_frame->key_frame; 355 int key_frame = stream->enc->coded_frame->key_frame;
386 stream->nb_frames++; 386 stream->nb_frames++;
387 return 0; 387 return 0;
388 } 388 }
389 389
390 static int rm_write_packet(AVFormatContext *s, int stream_index, 390 static int rm_write_packet(AVFormatContext *s, int stream_index,
391 UINT8 *buf, int size, int force_pts) 391 uint8_t *buf, int size, int force_pts)
392 { 392 {
393 if (s->streams[stream_index]->codec.codec_type == 393 if (s->streams[stream_index]->codec.codec_type ==
394 CODEC_TYPE_AUDIO) 394 CODEC_TYPE_AUDIO)
395 return rm_write_audio(s, buf, size); 395 return rm_write_audio(s, buf, size);
396 else 396 else
470 RMContext *rm = s->priv_data; 470 RMContext *rm = s->priv_data;
471 AVStream *st; 471 AVStream *st;
472 ByteIOContext *pb = &s->pb; 472 ByteIOContext *pb = &s->pb;
473 unsigned int tag, v; 473 unsigned int tag, v;
474 int tag_size, size, codec_data_size, i; 474 int tag_size, size, codec_data_size, i;
475 INT64 codec_pos; 475 int64_t codec_pos;
476 unsigned int h263_hack_version; 476 unsigned int h263_hack_version;
477 char buf[128]; 477 char buf[128];
478 int flags = 0; 478 int flags = 0;
479 479
480 if (get_le32(pb) != MKTAG('.', 'R', 'M', 'F')) 480 if (get_le32(pb) != MKTAG('.', 'R', 'M', 'F'))
648 { 648 {
649 RMContext *rm = s->priv_data; 649 RMContext *rm = s->priv_data;
650 ByteIOContext *pb = &s->pb; 650 ByteIOContext *pb = &s->pb;
651 AVStream *st; 651 AVStream *st;
652 int len, num, timestamp, i, tmp, j; 652 int len, num, timestamp, i, tmp, j;
653 UINT8 *ptr; 653 uint8_t *ptr;
654 int flags; 654 int flags;
655 655
656 redo: 656 redo:
657 if (rm->nb_packets == 0) 657 if (rm->nb_packets == 0)
658 return -EIO; 658 return -EIO;