- /* set the input output pts pairs */
- //ost->sync_ipts = (double)(ist->pts + input_files_ts_offset[ist->file_index] - start_time)/ AV_TIME_BASE;
-
- if (ost->encoding_needed) {
- switch(ost->st->codec->codec_type) {
- case CODEC_TYPE_AUDIO:
- do_audio_out(os, ost, ist, data_buf, data_size);
- break;
- case CODEC_TYPE_VIDEO:
- do_video_out(os, ost, ist, &picture, &frame_size);
- video_size += frame_size;
- if (do_vstats && frame_size)
- do_video_stats(os, ost, frame_size);
- break;
- case CODEC_TYPE_SUBTITLE:
- do_subtitle_out(os, ost, ist, &subtitle,
- pkt->pts);
- break;
- default:
- av_abort();
- }
- } else {
- AVFrame avframe; //FIXME/XXX remove this
- AVPacket opkt;
- av_init_packet(&opkt);
-
- /* no reencoding needed : output the packet directly */
- /* force the input stream PTS */
-
- avcodec_get_frame_defaults(&avframe);
- ost->st->codec->coded_frame= &avframe;
- avframe.key_frame = pkt->flags & PKT_FLAG_KEY;
-
- if(ost->st->codec->codec_type == CODEC_TYPE_AUDIO)
- audio_size += data_size;
- else if (ost->st->codec->codec_type == CODEC_TYPE_VIDEO) {
- video_size += data_size;
- ost->sync_opts++;
- }