Mercurial > libavformat.hg
comparison swf.c @ 1890:04f9a3ae30af libavformat
seems safer to set pts timebase to sample rate, fix some mp3
author | bcoudurier |
---|---|
date | Thu, 08 Mar 2007 22:14:04 +0000 |
parents | e81bae269ae1 |
children | 1a3c9056982a |
comparison
equal
deleted
inserted
replaced
1889:e81bae269ae1 | 1890:04f9a3ae30af |
---|---|
677 int sample_rate_code; | 677 int sample_rate_code; |
678 get_byte(pb); | 678 get_byte(pb); |
679 v = get_byte(pb); | 679 v = get_byte(pb); |
680 swf->samples_per_frame = get_le16(pb); | 680 swf->samples_per_frame = get_le16(pb); |
681 ast = av_new_stream(s, -1); /* -1 to avoid clash with video stream ch_id */ | 681 ast = av_new_stream(s, -1); /* -1 to avoid clash with video stream ch_id */ |
682 av_set_pts_info(ast, 64, 256, swf->frame_rate); /* XXX same as video stream */ | |
683 swf->audio_stream_index = ast->index; | 682 swf->audio_stream_index = ast->index; |
684 ast->codec->channels = 1 + (v&1); | 683 ast->codec->channels = 1 + (v&1); |
685 ast->codec->codec_type = CODEC_TYPE_AUDIO; | 684 ast->codec->codec_type = CODEC_TYPE_AUDIO; |
686 ast->codec->codec_id = codec_get_id(swf_audio_codec_tags, (v>>4) & 15); | 685 ast->codec->codec_id = codec_get_id(swf_audio_codec_tags, (v>>4) & 15); |
687 ast->need_parsing = 1; | 686 ast->need_parsing = 1; |
688 sample_rate_code= (v>>2) & 3; | 687 sample_rate_code= (v>>2) & 3; |
689 if (!sample_rate_code) | 688 if (!sample_rate_code) |
690 return AVERROR_IO; | 689 return AVERROR_IO; |
691 ast->codec->sample_rate = 11025 << (sample_rate_code-1); | 690 ast->codec->sample_rate = 11025 << (sample_rate_code-1); |
691 av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); | |
692 if (len > 4) | 692 if (len > 4) |
693 url_fskip(pb,len-4); | 693 url_fskip(pb,len-4); |
694 | 694 |
695 } else if (tag == TAG_JPEG2 && !vst) { | 695 } else if (tag == TAG_JPEG2 && !vst) { |
696 vst = av_new_stream(s, -2); /* -2 to avoid clash with video stream and audio stream */ | 696 vst = av_new_stream(s, -2); /* -2 to avoid clash with video stream and audio stream */ |