comparison swf.c @ 187:2fa5e94ba716 libavformat

add av_new_stream() usage
author bellard
date Fri, 08 Aug 2003 17:52:30 +0000
parents 25062c9b1f86
children 3d92f793fd67
comparison
equal deleted inserted replaced
186:2265d21a04c8 187:2fa5e94ba716
479 get_byte(pb); 479 get_byte(pb);
480 v = get_byte(pb); 480 v = get_byte(pb);
481 get_le16(pb); 481 get_le16(pb);
482 /* if mp3 streaming found, OK */ 482 /* if mp3 streaming found, OK */
483 if ((v & 0x20) != 0) { 483 if ((v & 0x20) != 0) {
484 st = av_mallocz(sizeof(AVStream)); 484 st = av_new_stream(s, 0);
485 if (!st) 485 if (!st)
486 return -ENOMEM; 486 return -ENOMEM;
487 avcodec_get_context_defaults(&st->codec);
488 487
489 if (v & 0x01) 488 if (v & 0x01)
490 st->codec.channels = 2; 489 st->codec.channels = 2;
491 else 490 else
492 st->codec.channels = 1; 491 st->codec.channels = 1;
493 s->nb_streams = 1;
494 s->streams[0] = st;
495 492
496 switch((v>> 2) & 0x03) { 493 switch((v>> 2) & 0x03) {
497 case 1: 494 case 1:
498 st->codec.sample_rate = 11025; 495 st->codec.sample_rate = 11025;
499 break; 496 break;