summaryrefslogtreecommitdiffstats
path: root/libhb/deca52.c
diff options
context:
space:
mode:
authorawk <[email protected]>2007-07-04 02:14:42 +0000
committerawk <[email protected]>2007-07-04 02:14:42 +0000
commit2e0106d686bb69faa1182dabbceb58969a93956f (patch)
treee00e2090e8a526e8e2baf205cdc4bbcda8825df4 /libhb/deca52.c
parent5ceeadd648a9952506bd3e166d9fdba1ae2b4da4 (diff)
Implement transport and program stream support. With these changes it's now possible to open a .ts or .mpg files and transcode to standard Handbrake Output files. This fixes Ticket #21.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@648 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/deca52.c')
-rw-r--r--libhb/deca52.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libhb/deca52.c b/libhb/deca52.c
index 2a8c53c31..88974d55d 100644
--- a/libhb/deca52.c
+++ b/libhb/deca52.c
@@ -25,6 +25,8 @@ struct hb_work_private_s
int sync;
int size;
+ int64_t next_expected_pts;
+
uint8_t frame[3840];
hb_list_t * list;
@@ -76,7 +78,8 @@ int deca52Init( hb_work_object_t * w, hb_job_t * job )
pv->out_discrete_channels = HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(w->amixdown);
pv->level = 32768.0;
-
+ pv->next_expected_pts = 0;
+
return 0;
}
@@ -191,9 +194,15 @@ static hb_buffer_t * Decode( hb_work_object_t * w )
/* 6 blocks per frame, 256 samples per block, channelsused channels */
buf = hb_buffer_init( 6 * 256 * pv->out_discrete_channels * sizeof( float ) );
+ if (pts == -1)
+ {
+ pts = pv->next_expected_pts;
+ }
buf->start = pts + ( pos / pv->size ) * 6 * 256 * 90000 / pv->rate;
buf->stop = buf->start + 6 * 256 * 90000 / pv->rate;
+ pv->next_expected_pts = buf->stop;
+
for( i = 0; i < 6; i++ )
{
sample_t * samples_in;