summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-01-26 18:01:50 +0000
committerjstebbins <[email protected]>2014-01-26 18:01:50 +0000
commit96fbc744385ddcc15617ba449d1521c30f66da3d (patch)
tree00a351c416a2307e511042d0a86bf4d3a2bfe7d1 /libhb/decavcodec.c
parent1d7db22df59be148ed995eee7755f21d8f0b9d5b (diff)
Replace invaled timestamp flag "-1" with AV_NOPTS
-1 is not a good value as a flag for invalid timestamps. There are cases where small negative timestamps are useful. So this eliminates a potential ambiguity. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6001 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index 73692de5f..b94168724 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -196,7 +196,7 @@ static int64_t heap_pop( pts_heap_t *heap )
if ( heap->nheap <= 0 )
{
- return -1;
+ return AV_NOPTS_VALUE;
}
// return the top of the heap then put the bottom element on top,
@@ -546,7 +546,7 @@ static int decavcodecaWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
*buf_out = NULL;
- if ( in->s.start < -1 && pv->pts_next <= 0 )
+ if ( in->s.start < 0 && pv->pts_next <= 0 )
{
// discard buffers that start before video time 0
return HB_WORK_OK;
@@ -566,8 +566,6 @@ static int decavcodecaWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
len = av_parser_parse2( pv->parser, pv->context, &pout, &pout_len,
in->data + pos, in->size - pos, cur, cur, 0 );
cur = pv->parser->pts;
- if ( cur == AV_NOPTS_VALUE )
- cur = -1;
}
else
{
@@ -2115,7 +2113,7 @@ static void decodeAudio(hb_audio_t *audio, hb_work_private_t *pv, uint8_t *data,
int pos = 0;
// If we are given a pts, use it; but don't lose partial ticks.
- if (pts != -1 && (int64_t)pv->pts_next != pts)
+ if (pts != AV_NOPTS_VALUE && (int64_t)pv->pts_next != pts)
pv->pts_next = pts;
while (pos < size)
{