Changeset 6c955787f04e378771f64a66332218c522e7810e
- Timestamp:
- 06/03/04 20:30:19
(5 years ago)
- Author:
- Gildas Bazin <gbazin@videolan.org>
- git-committer:
- Gildas Bazin <gbazin@videolan.org> 1078601419 +0000
- git-parent:
[116b248f45c865379ea479e3b7eaae038795200f]
- git-author:
- Gildas Bazin <gbazin@videolan.org> 1078601419 +0000
- Message:
* src/input/input_dec.c: fix for input_EndDecoder() when using the async mode.
* modules/packetizer/copy.c: better not send pts instead of invalid ones.
* modules/stream_out/transcode.c: when no pts, use dts wherever possible (low delay / b frame).
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rf7fd8b6 |
r6c95578 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001, 2002 VideoLAN |
|---|
| 5 | | * $Id: copy.c,v 1.23 2004/01/25 17:58:30 murray Exp $ |
|---|
| | 5 | * $Id$ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 262 | 262 | *pp_block = NULL; |
|---|
| 263 | 263 | |
|---|
| 264 | | if( p_block->i_pts <= 0 ) |
|---|
| 265 | | { |
|---|
| 266 | | p_block->i_pts = p_block->i_dts; |
|---|
| 267 | | } |
|---|
| 268 | | else if( p_block->i_dts <= 0 ) |
|---|
| | 264 | if( p_block->i_dts <= 0 ) |
|---|
| 269 | 265 | { |
|---|
| 270 | 266 | p_block->i_dts = p_block->i_pts; |
|---|
| 271 | 267 | } |
|---|
| 272 | 268 | |
|---|
| 273 | | if( p_block->i_pts <= 0 ) |
|---|
| 274 | | { |
|---|
| 275 | | msg_Dbg( p_dec, "need pts > 0" ); |
|---|
| | 269 | if( p_block->i_dts <= 0 ) |
|---|
| | 270 | { |
|---|
| | 271 | msg_Dbg( p_dec, "need dts > 0" ); |
|---|
| 276 | 272 | block_Release( p_block ); |
|---|
| 277 | 273 | return NULL; |
|---|
| … | … | |
| 286 | 282 | return p_ret; |
|---|
| 287 | 283 | } |
|---|
| 288 | | |
|---|
| rca7c328 |
r6c95578 |
|
| 137 | 137 | int i_crop_left; |
|---|
| 138 | 138 | |
|---|
| | 139 | mtime_t i_input_dts; |
|---|
| 139 | 140 | mtime_t i_input_pts; |
|---|
| | 141 | vlc_bool_t b_input_has_b_frames; |
|---|
| | 142 | |
|---|
| 140 | 143 | mtime_t i_output_pts; |
|---|
| 141 | 144 | }; |
|---|
| … | … | |
| 168 | 171 | p_sys->i_threads = 0; |
|---|
| 169 | 172 | p_sys->b_trellis = 0; |
|---|
| | 173 | p_sys->b_input_has_b_frames = VLC_FALSE; |
|---|
| 170 | 174 | |
|---|
| 171 | 175 | if( ( codec = sout_cfg_find_value( p_stream->p_cfg, "acodec" ) ) ) |
|---|
| … | … | |
| 1331 | 1335 | i_data = in->i_size; |
|---|
| 1332 | 1336 | p_data = in->p_buffer; |
|---|
| 1333 | | |
|---|
| | 1337 | |
|---|
| 1334 | 1338 | for( ;; ) |
|---|
| 1335 | 1339 | { |
|---|
| … | … | |
| 1341 | 1345 | frame = id->p_ff_pic; |
|---|
| 1342 | 1346 | p_sys->i_input_pts = in->i_pts; |
|---|
| | 1347 | p_sys->i_input_dts = in->i_dts; |
|---|
| 1343 | 1348 | if( id->ff_dec ) |
|---|
| 1344 | 1349 | { |
|---|
| … | … | |
| 1359 | 1364 | frame->pts = p_sys->i_input_pts ? p_sys->i_input_pts : |
|---|
| 1360 | 1365 | AV_NOPTS_VALUE; |
|---|
| | 1366 | |
|---|
| | 1367 | frame->pict_type = FF_I_TYPE; |
|---|
| 1361 | 1368 | } |
|---|
| 1362 | 1369 | |
|---|
| … | … | |
| 1379 | 1386 | { |
|---|
| 1380 | 1387 | p_sys->i_output_pts = frame->pts; |
|---|
| | 1388 | } |
|---|
| | 1389 | |
|---|
| | 1390 | /* Sanity check (seems to be needed for some streams ) */ |
|---|
| | 1391 | if( frame->pict_type == FF_B_TYPE ) |
|---|
| | 1392 | { |
|---|
| | 1393 | p_sys->b_input_has_b_frames = VLC_TRUE; |
|---|
| 1381 | 1394 | } |
|---|
| 1382 | 1395 | |
|---|
| … | … | |
| 1759 | 1772 | |
|---|
| 1760 | 1773 | /* Set PTS */ |
|---|
| 1761 | | p_frame->pts = p_sys->i_input_pts ? p_sys->i_input_pts : AV_NOPTS_VALUE; |
|---|
| | 1774 | if( p_sys->i_input_pts ) |
|---|
| | 1775 | { |
|---|
| | 1776 | p_frame->pts = p_sys->i_input_pts; |
|---|
| | 1777 | } |
|---|
| | 1778 | else if( p_sys->i_input_dts ) |
|---|
| | 1779 | { |
|---|
| | 1780 | /* Some demuxers/packetizers only set the dts so let's try to find a |
|---|
| | 1781 | * useful timestamp from this */ |
|---|
| | 1782 | if( !p_context->has_b_frames || !p_sys->b_input_has_b_frames || |
|---|
| | 1783 | !p_frame->reference ) |
|---|
| | 1784 | { |
|---|
| | 1785 | p_frame->pts = p_sys->i_input_dts; |
|---|
| | 1786 | } |
|---|
| | 1787 | else p_frame->pts = AV_NOPTS_VALUE; |
|---|
| | 1788 | } |
|---|
| | 1789 | else p_frame->pts = AV_NOPTS_VALUE; |
|---|
| | 1790 | |
|---|
| | 1791 | p_sys->i_input_pts = 0; |
|---|
| | 1792 | p_sys->i_input_dts = 0; |
|---|
| 1762 | 1793 | |
|---|
| 1763 | 1794 | return avcodec_default_get_buffer( p_context, p_frame ); |
|---|
| r1d7b91d |
r6c95578 |
|
| 286 | 286 | { |
|---|
| 287 | 287 | /* FIXME !!!!! */ |
|---|
| 288 | | while( p_dec->p_owner->p_fifo->i_depth > 10 ) |
|---|
| | 288 | while( !p_dec->b_die && !p_dec->b_error && |
|---|
| | 289 | p_dec->p_owner->p_fifo->i_depth > 10 ) |
|---|
| 289 | 290 | { |
|---|
| 290 | 291 | msleep( 1000 ); |
|---|