Mercurial > mplayer.hg
comparison libmpdemux/muxer_lavf.c @ 15011:83077e6742e7
various (de)muxer_lavf fixes
author | michael |
---|---|
date | Fri, 25 Mar 2005 22:47:09 +0000 |
parents | 4abf8628ee74 |
children | f48dc20c9185 |
comparison
equal
deleted
inserted
replaced
15010:aec21cf429cb | 15011:83077e6742e7 |
---|---|
159 mp_msg(MSGT_MUXER, MSGL_INFO, "AUDIO CODEC ID: %x, TAG: %x\n", ctx->codec_id, (uint32_t) ctx->codec_tag); | 159 mp_msg(MSGT_MUXER, MSGL_INFO, "AUDIO CODEC ID: %x, TAG: %x\n", ctx->codec_id, (uint32_t) ctx->codec_tag); |
160 ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8; | 160 ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8; |
161 ctx->sample_rate = stream->wf->nSamplesPerSec; | 161 ctx->sample_rate = stream->wf->nSamplesPerSec; |
162 // mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize); | 162 // mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize); |
163 ctx->channels = stream->wf->nChannels; | 163 ctx->channels = stream->wf->nChannels; |
164 ctx->frame_size = 576; | 164 if(stream->h.dwRate && (stream->h.dwScale * (int64_t)ctx->sample_rate) % stream->h.dwRate == 0) |
165 ctx->frame_size= (stream->h.dwScale * (int64_t)ctx->sample_rate) / stream->h.dwRate; | |
166 // printf("ctx->block_align = stream->wf->nBlockAlign; %d=%d stream->wf->nAvgBytesPerSec:%d\n", ctx->block_align, stream->wf->nBlockAlign, stream->wf->nAvgBytesPerSec); | |
165 ctx->block_align = stream->wf->nBlockAlign; | 167 ctx->block_align = stream->wf->nBlockAlign; |
166 } | 168 } |
167 else if(stream->type == MUXER_TYPE_VIDEO) | 169 else if(stream->type == MUXER_TYPE_VIDEO) |
168 { | 170 { |
169 ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression); | 171 ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression); |
170 mp_msg(MSGT_MUXER, MSGL_INFO, "VIDEO CODEC ID: %d\n", ctx->codec_id); | 172 mp_msg(MSGT_MUXER, MSGL_INFO, "VIDEO CODEC ID: %d\n", ctx->codec_id); |
171 ctx->width = stream->bih->biWidth; | 173 ctx->width = stream->bih->biWidth; |
172 ctx->height = stream->bih->biHeight; | 174 ctx->height = stream->bih->biHeight; |
173 ctx->bit_rate = 800000; | 175 ctx->bit_rate = 800000; |
174 ctx->frame_rate = (int) (10000 * stream->h.dwRate)/ stream->h.dwScale;; | 176 ctx->frame_rate = stream->h.dwRate; |
175 ctx->frame_rate_base = 10000; | 177 ctx->frame_rate_base = stream->h.dwScale; |
176 } | 178 } |
177 } | 179 } |
178 | 180 |
179 static void write_chunk(muxer_stream_t *stream, size_t len, unsigned int flags) | 181 static void write_chunk(muxer_stream_t *stream, size_t len, unsigned int flags) |
180 { | 182 { |