diff options
author | jstebbins <[email protected]> | 2015-05-01 14:47:35 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-05-01 14:47:35 +0000 |
commit | 58b25a7664d9d063b404ec39270ff4cdfa333979 (patch) | |
tree | 3807be923b500ddc3f618170b7bd7c4900204bdd /libhb/decavcodec.c | |
parent | 3e30a6ef3a449ac4cadb60fa738cc58f974c1794 (diff) |
libhb: Use a buffer flat to indicate EOF
... instead of a 0 length buffer.
This fixes this issue:
https://forum.handbrake.fr/viewtopic.php?f=12&t=31959
Theora can create 0 length output. These 0 length frames indicate
duplicate frames. So we can't use 0 length buffers to indicate the end
of the stream.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7143 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r-- | libhb/decavcodec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 32eb4a21a..bdca1e180 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -535,7 +535,7 @@ static int decavcodecaWork( hb_work_object_t * w, hb_buffer_t ** buf_in, hb_work_private_t * pv = w->private_data; hb_buffer_t * in = *buf_in; - if ( in->size <= 0 ) + if (in->s.flags & HB_BUF_FLAG_EOF) { /* EOF on input stream - send it downstream & say that we're done */ *buf_out = in; @@ -1564,7 +1564,7 @@ static void decodeVideo( hb_work_object_t *w, uint8_t *data, int size, int seque #endif flushDelayQueue(pv); if (pv->list_subtitle != NULL) - cc_send_to_decoder(pv, hb_buffer_init(0)); + cc_send_to_decoder(pv, hb_buffer_eof_init()); } } @@ -1810,11 +1810,11 @@ static int decavcodecvWork( hb_work_object_t * w, hb_buffer_t ** buf_in, *buf_out = NULL; /* if we got an empty buffer signaling end-of-stream send it downstream */ - if ( in->size == 0 ) + if (in->s.flags & HB_BUF_FLAG_EOF) { if (pv->context != NULL && pv->context->codec != NULL) { - decodeVideo( w, in->data, in->size, in->sequence, pts, dts, in->s.frametype ); + decodeVideo(w, in->data, 0, 0, pts, dts, 0); } hb_list_add( pv->list, in ); *buf_out = link_buf_list( pv ); @@ -1841,7 +1841,7 @@ static int decavcodecvWork( hb_work_object_t * w, hb_buffer_t ** buf_in, if ( codec == NULL ) { hb_log( "decavcodecvWork: failed to find codec for id (%d)", w->codec_param ); - *buf_out = hb_buffer_init( 0 );; + *buf_out = hb_buffer_eof_init(); return HB_WORK_DONE; } @@ -1882,7 +1882,7 @@ static int decavcodecvWork( hb_work_object_t * w, hb_buffer_t ** buf_in, { av_dict_free( &av_opts ); hb_log( "decavcodecvWork: avcodec_open failed" ); - *buf_out = hb_buffer_init( 0 );; + *buf_out = hb_buffer_eof_init(); return HB_WORK_DONE; } av_dict_free( &av_opts ); |