Mercurial > mplayer.hg
comparison mencoder.c @ 37102:0bbd04a5f920
mencoder: simplify audio copy case.
author | reimar |
---|---|
date | Sat, 10 May 2014 20:23:21 +0000 |
parents | ab6b3fd992dc |
children | c0ab95217af3 |
comparison
equal
deleted
inserted
replaced
37101:ab6b3fd992dc | 37102:0bbd04a5f920 |
---|---|
1371 mux_a->buffer_len += len; | 1371 mux_a->buffer_len += len; |
1372 } | 1372 } |
1373 } | 1373 } |
1374 if (v_muxer_time == 0) mux_a->h.dwInitialFrames++; | 1374 if (v_muxer_time == 0) mux_a->h.dwInitialFrames++; |
1375 } | 1375 } |
1376 else { | 1376 else if (mux_a->codec == ACODEC_COPY) { |
1377 if(mux_a->h.dwSampleSize){ | 1377 if(mux_a->h.dwSampleSize){ |
1378 int len; | 1378 int len; |
1379 switch(mux_a->codec){ | |
1380 case ACODEC_COPY: // copy | |
1381 len=mux_a->wf->nAvgBytesPerSec*tottime; | 1379 len=mux_a->wf->nAvgBytesPerSec*tottime; |
1382 len/=mux_a->h.dwSampleSize;if(len<1) len=1; | 1380 len/=mux_a->h.dwSampleSize;if(len<1) len=1; |
1383 len*=mux_a->h.dwSampleSize; | 1381 len*=mux_a->h.dwSampleSize; |
1384 bytes_to_mux=demux_read_data(sh_audio->ds,mux_a->buffer,len); | 1382 bytes_to_mux=demux_read_data(sh_audio->ds,mux_a->buffer,len); |
1385 break; | |
1386 } | |
1387 } else { | 1383 } else { |
1388 // VBR - encode/copy an audio frame | 1384 // VBR - encode/copy an audio frame |
1389 switch(mux_a->codec){ | |
1390 case ACODEC_COPY: // copy | |
1391 bytes_to_mux=ds_get_packet(sh_audio->ds,(unsigned char**) &mux_a->buffer); | 1385 bytes_to_mux=ds_get_packet(sh_audio->ds,(unsigned char**) &mux_a->buffer); |
1392 break; | |
1393 } | |
1394 } | 1386 } |
1395 } | 1387 } |
1396 if(bytes_to_mux<=0) { | 1388 if(bytes_to_mux<=0) { |
1397 // EOF? | 1389 // EOF? |
1398 if (!sh_audio->a_out_buffer_len && sh_audio->ds->eof) { | 1390 if (!sh_audio->a_out_buffer_len && sh_audio->ds->eof) { |