| OLD | NEW |
| 1 /* | 1 /* |
| 2 * amr file format | 2 * amr file format |
| 3 * Copyright (c) 2001 ffmpeg project | 3 * Copyright (c) 2001 ffmpeg project |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 { | 93 { |
| 94 get_buffer(pb, header+6, 3); | 94 get_buffer(pb, header+6, 3); |
| 95 if(memcmp(header,AMRWB_header,9)!=0) | 95 if(memcmp(header,AMRWB_header,9)!=0) |
| 96 { | 96 { |
| 97 return -1; | 97 return -1; |
| 98 } | 98 } |
| 99 | 99 |
| 100 st->codec->codec_tag = MKTAG('s', 'a', 'w', 'b'); | 100 st->codec->codec_tag = MKTAG('s', 'a', 'w', 'b'); |
| 101 st->codec->codec_id = CODEC_ID_AMR_WB; | 101 st->codec->codec_id = CODEC_ID_AMR_WB; |
| 102 st->codec->sample_rate = 16000; | 102 st->codec->sample_rate = 16000; |
| 103 st->codec->frame_size = 320; |
| 103 } | 104 } |
| 104 else | 105 else |
| 105 { | 106 { |
| 106 st->codec->codec_tag = MKTAG('s', 'a', 'm', 'r'); | 107 st->codec->codec_tag = MKTAG('s', 'a', 'm', 'r'); |
| 107 st->codec->codec_id = CODEC_ID_AMR_NB; | 108 st->codec->codec_id = CODEC_ID_AMR_NB; |
| 108 st->codec->sample_rate = 8000; | 109 st->codec->sample_rate = 8000; |
| 110 st->codec->frame_size = 160; |
| 109 } | 111 } |
| 110 st->codec->channels = 1; | 112 st->codec->channels = 1; |
| 111 st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | 113 st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
| 112 av_set_pts_info(st, 64, 1, st->codec->sample_rate); | 114 av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
| 113 | 115 |
| 114 return 0; | 116 return 0; |
| 115 } | 117 } |
| 116 | 118 |
| 117 static int amr_read_packet(AVFormatContext *s, | 119 static int amr_read_packet(AVFormatContext *s, |
| 118 AVPacket *pkt) | 120 AVPacket *pkt) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 NULL_IF_CONFIG_SMALL("3GPP AMR file format"), | 186 NULL_IF_CONFIG_SMALL("3GPP AMR file format"), |
| 185 "audio/amr", | 187 "audio/amr", |
| 186 "amr", | 188 "amr", |
| 187 0, | 189 0, |
| 188 CODEC_ID_AMR_NB, | 190 CODEC_ID_AMR_NB, |
| 189 CODEC_ID_NONE, | 191 CODEC_ID_NONE, |
| 190 amr_write_header, | 192 amr_write_header, |
| 191 amr_write_packet, | 193 amr_write_packet, |
| 192 }; | 194 }; |
| 193 #endif | 195 #endif |
| OLD | NEW |