summaryrefslogtreecommitdiff
path: root/libavformat/rmenc.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-01-01 15:51:58 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-01-01 15:51:58 +0100
commit53448461a7720afab0d1f1234af79573fd2e020d (patch)
tree5fec5db11035224ce20ff992e5bd536e0574b4f7 /libavformat/rmenc.c
parentb47111b6579fbe07b09bb360732b140ad6e870db (diff)
parent1f008f34d5b2b5f6217521747e7acfe3efc0e666 (diff)
downloadffmpeg-53448461a7720afab0d1f1234af79573fd2e020d.tar.gz
Merge commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666'
* commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666': rmenc: do not use AVCodecContext.frame_size Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/rmenc.c')
-rw-r--r--libavformat/rmenc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index b39d99170d..33eaf6360d 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -185,9 +185,10 @@ static int rv10_write_header(AVFormatContext *ctx,
if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
int coded_frame_size, fscode, sample_rate;
+ int frame_size = av_get_audio_frame_duration(stream->enc, 0);
sample_rate = stream->enc->sample_rate;
coded_frame_size = (stream->enc->bit_rate *
- stream->enc->frame_size) / (8 * sample_rate);
+ frame_size) / (8 * sample_rate);
/* audio codec info */
avio_write(s, ".ra", 3);
avio_w8(s, 0xfd);
@@ -320,6 +321,7 @@ static int rm_write_header(AVFormatContext *s)
for(n=0;n<s->nb_streams;n++) {
AVStream *st = s->streams[n];
+ int frame_size;
s->streams[n]->id = n;
codec = s->streams[n]->codec;
@@ -332,7 +334,8 @@ static int rm_write_header(AVFormatContext *s)
switch(codec->codec_type) {
case AVMEDIA_TYPE_AUDIO:
rm->audio_stream = stream;
- stream->frame_rate = (AVRational){codec->sample_rate, codec->frame_size};
+ frame_size = av_get_audio_frame_duration(codec, 0);
+ stream->frame_rate = (AVRational){codec->sample_rate, frame_size};
/* XXX: dummy values */
stream->packet_max_size = 1024;
stream->nb_packets = 0;