Changeset c4d19b859876eee3510940ae172d66d4723ba1a8
- Timestamp:
- 13/10/07 01:41:31
(1 year ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1192232491 +0000
- git-parent:
[8281a1556a25c368985933c44c2cbc3667bd5f62]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1192232491 +0000
- Message:
Added sout-mux-caching option. It allow to set the initial muxer cache value
in millisecond.
Original patch created by Jeff Hansen.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd1167c2 |
rc4d19b8 |
|
| 844 | 844 | "multiple playlist item (automatically insert the gather stream output " \ |
|---|
| 845 | 845 | "if not specified)" ) |
|---|
| | 846 | |
|---|
| | 847 | #define SOUT_MUX_CACHING_TEXT N_("Stream output muxer caching (ms)") |
|---|
| | 848 | #define SOUT_MUX_CACHING_LONGTEXT N_( \ |
|---|
| | 849 | "This allow you to configure the initial caching amount for stream output " \ |
|---|
| | 850 | " muxer. This value should be set in milliseconds." ) |
|---|
| 846 | 851 | |
|---|
| 847 | 852 | #define PACKETIZER_TEXT N_("Preferred packetizer list") |
|---|
| … | … | |
| 1687 | 1692 | add_bool( "sout-spu", 1, NULL, SOUT_SPU_TEXT, |
|---|
| 1688 | 1693 | SOUT_SPU_LONGTEXT, VLC_TRUE ); |
|---|
| | 1694 | add_integer( "sout-mux-caching", 1500, NULL, SOUT_MUX_CACHING_TEXT, |
|---|
| | 1695 | SOUT_MUX_CACHING_LONGTEXT, VLC_TRUE ); |
|---|
| 1689 | 1696 | |
|---|
| 1690 | 1697 | set_section( N_("VLM"), NULL ); |
|---|
| r4ff9961 |
rc4d19b8 |
|
| 104 | 104 | vlc_object_attach( p_sout, p_parent ); |
|---|
| 105 | 105 | |
|---|
| | 106 | /* */ |
|---|
| | 107 | var_Create( p_sout, "sout-mux-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); |
|---|
| | 108 | |
|---|
| | 109 | /* */ |
|---|
| 106 | 110 | p_sout->p_stream = sout_StreamNew( p_sout, p_sout->psz_chain ); |
|---|
| 107 | | |
|---|
| 108 | 111 | if( p_sout->p_stream == NULL ) |
|---|
| 109 | 112 | { |
|---|
| … | … | |
| 471 | 474 | { |
|---|
| 472 | 475 | msg_Err( p_mux, "cannot add a new stream (unsupported while muxing " |
|---|
| 473 | | "to this format)" ); |
|---|
| | 476 | "to this format). You can try increasing sout-mux-caching value" ); |
|---|
| 474 | 477 | return NULL; |
|---|
| 475 | 478 | } |
|---|
| … | … | |
| 552 | 555 | if( p_mux->b_waiting_stream ) |
|---|
| 553 | 556 | { |
|---|
| | 557 | const int64_t i_caching = var_GetInteger( p_mux->p_sout, "sout-mux-caching" ) * I64C(1000); |
|---|
| | 558 | |
|---|
| 554 | 559 | if( p_mux->i_add_stream_start < 0 ) |
|---|
| 555 | | { |
|---|
| 556 | 560 | p_mux->i_add_stream_start = p_buffer->i_dts; |
|---|
| 557 | | } |
|---|
| 558 | | |
|---|
| 559 | | if( p_mux->i_add_stream_start >= 0 && |
|---|
| 560 | | p_mux->i_add_stream_start + I64C(1500000) < p_buffer->i_dts ) |
|---|
| 561 | | { |
|---|
| 562 | | /* Wait until we have more than 1.5 seconds worth of data |
|---|
| 563 | | * before start muxing */ |
|---|
| 564 | | p_mux->b_waiting_stream = VLC_FALSE; |
|---|
| 565 | | } |
|---|
| 566 | | else |
|---|
| 567 | | { |
|---|
| | 561 | |
|---|
| | 562 | /* Wait until we have enought data before muxing */ |
|---|
| | 563 | if( p_mux->i_add_stream_start < 0 || |
|---|
| | 564 | p_buffer->i_dts < p_mux->i_add_stream_start + i_caching ) |
|---|
| 568 | 565 | return; |
|---|
| 569 | | } |
|---|
| | 566 | p_mux->b_waiting_stream = VLC_FALSE; |
|---|
| 570 | 567 | } |
|---|
| 571 | 568 | p_mux->pf_mux( p_mux ); |
|---|