2 #include "mpeg3protos.h"
6 mpeg3_vtrack_t
* mpeg3_new_vtrack(mpeg3_t
*file
,
8 mpeg3_demuxer_t
*demuxer
,
12 mpeg3_vtrack_t
*new_vtrack
;
14 //printf("mpeg3_new_vtrack 1\n");
15 new_vtrack
= calloc(1, sizeof(mpeg3_vtrack_t
));
16 new_vtrack
->demuxer
= mpeg3_new_demuxer(file
, 0, 1, stream_id
);
17 if(new_vtrack
->demuxer
) mpeg3demux_copy_titles(new_vtrack
->demuxer
, demuxer
);
18 new_vtrack
->current_position
= 0;
20 //printf("mpeg3_new_vtrack 10\n");
22 if(file
->frame_offsets
)
24 new_vtrack
->frame_offsets
= file
->frame_offsets
[number
];
25 new_vtrack
->total_frame_offsets
= file
->total_frame_offsets
[number
];
26 new_vtrack
->keyframe_numbers
= file
->keyframe_numbers
[number
];
27 new_vtrack
->total_keyframe_numbers
= file
->total_keyframe_numbers
[number
];
30 //printf("mpeg3_new_vtrack 20\n");
31 //printf("mpeg3_new_vtrack %llx\n", mpeg3demux_tell(new_vtrack->demuxer));
32 /* Get information about the track here. */
33 new_vtrack
->video
= mpeg3video_new(file
, new_vtrack
);
34 if(!new_vtrack
->video
)
37 mpeg3_delete_vtrack(file
, new_vtrack
);
41 //printf("mpeg3_new_vtrack 100\n");
46 int mpeg3_delete_vtrack(mpeg3_t
*file
, mpeg3_vtrack_t
*vtrack
)
48 if(vtrack
->video
) mpeg3video_delete(vtrack
->video
);
49 if(vtrack
->demuxer
) mpeg3_delete_demuxer(vtrack
->demuxer
);