summaryrefslogtreecommitdiffstats
path: root/libmpdemux/muxer_lavf.c
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-03-25 22:47:09 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-03-25 22:47:09 +0000
commit7beeedc331aeac0cd812ee2b40fe5a63be9a04f2 (patch)
tree48d3b983c00fc38a36b1c50739c9b469bdb7a6cf /libmpdemux/muxer_lavf.c
parentf76031552b4e9e357687b6f1610de30124e08679 (diff)
downloadmpv-7beeedc331aeac0cd812ee2b40fe5a63be9a04f2.tar.bz2
mpv-7beeedc331aeac0cd812ee2b40fe5a63be9a04f2.tar.xz
various (de)muxer_lavf fixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15012 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/muxer_lavf.c')
-rw-r--r--libmpdemux/muxer_lavf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libmpdemux/muxer_lavf.c b/libmpdemux/muxer_lavf.c
index 39452bdc11..3af551b9ab 100644
--- a/libmpdemux/muxer_lavf.c
+++ b/libmpdemux/muxer_lavf.c
@@ -161,7 +161,9 @@ static void fix_parameters(muxer_stream_t *stream, void *sh)
ctx->sample_rate = stream->wf->nSamplesPerSec;
// mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize);
ctx->channels = stream->wf->nChannels;
- ctx->frame_size = 576;
+ if(stream->h.dwRate && (stream->h.dwScale * (int64_t)ctx->sample_rate) % stream->h.dwRate == 0)
+ ctx->frame_size= (stream->h.dwScale * (int64_t)ctx->sample_rate) / stream->h.dwRate;
+// printf("ctx->block_align = stream->wf->nBlockAlign; %d=%d stream->wf->nAvgBytesPerSec:%d\n", ctx->block_align, stream->wf->nBlockAlign, stream->wf->nAvgBytesPerSec);
ctx->block_align = stream->wf->nBlockAlign;
}
else if(stream->type == MUXER_TYPE_VIDEO)
@@ -171,8 +173,8 @@ static void fix_parameters(muxer_stream_t *stream, void *sh)
ctx->width = stream->bih->biWidth;
ctx->height = stream->bih->biHeight;
ctx->bit_rate = 800000;
- ctx->frame_rate = (int) (10000 * stream->h.dwRate)/ stream->h.dwScale;;
- ctx->frame_rate_base = 10000;
+ ctx->frame_rate = stream->h.dwRate;
+ ctx->frame_rate_base = stream->h.dwScale;
}
}