Changeset a9b034cf7998a55b8403858e83ad481a803cf79d
- Timestamp:
- 05/03/08 22:07:15
(2 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1209845235 +0300
- git-parent:
[976b9f6dc9259e4532a01502d00aa91c95f455e8]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1209845201 +0300
- Message:
Remove splice support - it does not quite help for UDP & DCCP
(at least currently)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5d1e0c0 |
ra9b034c |
|
| 474 | 474 | |
|---|
| 475 | 475 | AC_CHECK_FUNCS(mmap, [VLC_ADD_PLUGIN([access_mmap])]) |
|---|
| 476 | | |
|---|
| 477 | | AS_IF([test "${SYS}" = "linux"], [ |
|---|
| 478 | | AC_CHECK_FUNCS(tee) |
|---|
| 479 | | ]) |
|---|
| 480 | 476 | |
|---|
| 481 | 477 | dnl Check for setlocal and langinfo |
|---|
| rb2b9fb4 |
ra9b034c |
|
| 1362 | 1362 | sout_stream_id_t *id = (sout_stream_id_t *)p_this; |
|---|
| 1363 | 1363 | unsigned i_caching = id->i_caching; |
|---|
| 1364 | | #ifdef HAVE_TEE |
|---|
| 1365 | | int fd[5] = { -1, -1, -1, -1, -1 }; |
|---|
| 1366 | | |
|---|
| 1367 | | if( pipe( fd ) ) |
|---|
| 1368 | | fd[0] = fd[1] = -1; |
|---|
| 1369 | | else |
|---|
| 1370 | | if( pipe( fd ) ) |
|---|
| 1371 | | fd[2] = fd[3] = -1; |
|---|
| 1372 | | else |
|---|
| 1373 | | fd[4] = open( "/dev/null", O_WRONLY ); |
|---|
| 1374 | | #endif |
|---|
| 1375 | 1364 | |
|---|
| 1376 | 1365 | while( !id->b_die ) |
|---|
| … | … | |
| 1383 | 1372 | ssize_t len = out->i_buffer; |
|---|
| 1384 | 1373 | |
|---|
| 1385 | | #ifdef HAVE_TEE |
|---|
| 1386 | | if( fd[4] != -1 ) |
|---|
| 1387 | | len = write( fd[1], out->p_buffer, len); |
|---|
| 1388 | | if( len == -1 ) |
|---|
| 1389 | | continue; /* Uho - should not happen */ |
|---|
| 1390 | | #endif |
|---|
| 1391 | 1374 | mwait( i_date ); |
|---|
| 1392 | 1375 | |
|---|
| … | … | |
| 1399 | 1382 | SendRTCP( id->sinkv[i].rtcp, out ); |
|---|
| 1400 | 1383 | |
|---|
| 1401 | | #ifdef HAVE_TEE |
|---|
| 1402 | | tee( fd[0], fd[3], len, 0 ); |
|---|
| 1403 | | if( splice( fd[2], NULL, id->sinkv[i].rtp_fd, NULL, len, |
|---|
| 1404 | | SPLICE_F_NONBLOCK ) >= 0 ) |
|---|
| 1405 | | continue; |
|---|
| 1406 | | if( errno == EAGAIN ) |
|---|
| 1407 | | continue; |
|---|
| 1408 | | |
|---|
| 1409 | | /* splice failed */ |
|---|
| 1410 | | splice( fd[2], NULL, fd[4], NULL, len, 0 ); |
|---|
| 1411 | | #else |
|---|
| 1412 | 1384 | if( send( id->sinkv[i].rtp_fd, out->p_buffer, len, 0 ) >= 0 ) |
|---|
| 1413 | 1385 | continue; |
|---|
| 1414 | | #endif |
|---|
| 1415 | 1386 | /* Retry sending to root out soft-errors */ |
|---|
| 1416 | 1387 | if( send( id->sinkv[i].rtp_fd, out->p_buffer, len, 0 ) >= 0 ) |
|---|
| … | … | |
| 1420 | 1391 | } |
|---|
| 1421 | 1392 | vlc_mutex_unlock( &id->lock_sink ); |
|---|
| 1422 | | |
|---|
| 1423 | 1393 | block_Release( out ); |
|---|
| 1424 | | #ifdef HAVE_TEE |
|---|
| 1425 | | splice( fd[0], NULL, fd[4], NULL, len, 0 ); |
|---|
| 1426 | | #endif |
|---|
| 1427 | 1394 | |
|---|
| 1428 | 1395 | for( unsigned i = 0; i < deadc; i++ ) |
|---|
| … | … | |
| 1442 | 1409 | } |
|---|
| 1443 | 1410 | } |
|---|
| 1444 | | |
|---|
| 1445 | | #ifdef HAVE_TEE |
|---|
| 1446 | | for( unsigned i = 0; i < 5; i++ ) |
|---|
| 1447 | | close( fd[i] ); |
|---|
| 1448 | | #endif |
|---|
| 1449 | 1411 | } |
|---|
| 1450 | 1412 | |
|---|