WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / libhb / encvobsub.c
blob3994a491af6949bfe800331bbb8a1bf271dcd09b
1 /* encvobsub.c
3 Copyright (c) 2003-2015 HandBrake Team
4 This file is part of the HandBrake source code
5 Homepage: <http://handbrake.fr/>.
6 It may be used under the terms of the GNU General Public License v2.
7 For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html
8 */
10 #include "hb.h"
12 struct hb_work_private_s
14 hb_job_t * job;
17 int encsubInit( hb_work_object_t * w, hb_job_t * job )
19 hb_work_private_t * pv;
21 pv = calloc( 1, sizeof( hb_work_private_t ) );
22 w->private_data = pv;
24 pv->job = job;
26 return 0;
29 int encsubWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
30 hb_buffer_t ** buf_out )
32 hb_buffer_t * in = *buf_in;
34 if (w->subtitle->source != VOBSUB)
36 // Invalid source, send EOF, this shouldn't ever happen
37 hb_log("encvobsub: invalid subtitle source");
38 hb_buffer_close( buf_in );
39 *buf_out = hb_buffer_eof_init();
41 if (in->s.flags & HB_BUF_FLAG_EOF)
43 /* EOF on input stream - send it downstream & say that we're done */
44 *buf_out = in;
45 *buf_in = NULL;
46 return HB_WORK_DONE;
50 * Not much to do, just pass the buffer on.
51 * Some day, we may re-encode bd subtitles here ;)
53 if (buf_out)
55 *buf_out = in;
56 *buf_in = NULL;
59 return HB_WORK_OK;
62 void encsubClose( hb_work_object_t * w )
64 free( w->private_data );
67 hb_work_object_t hb_encvobsub =
69 WORK_ENCVOBSUB,
70 "VOBSUB encoder",
71 encsubInit,
72 encsubWork,
73 encsubClose