History

ffmpeg: change sync_opts code to be more similar to qatar.

Michael Niedermayer committed 14 years ago

Commit d8710221 parent c84acc31 file · +4 −3Browse files

Unified · Split

ffmpeg.c+4−3
@@ -1078,6 +1078,8 @@ static int encode_audio_frame(AVFormatContext *s, OutputStream *ost, · 1077 unmodified lines
1078 av_log(NULL, AV_LOG_FATAL, "Audio encoding failed\n");1078 av_log(NULL, AV_LOG_FATAL, "Audio encoding failed\n");
1079 exit_program(1);1079 exit_program(1);
1080 }1080 }
1081
1082 ost->sync_opts += frame->nb_samples;
1081 }1083 }
1082 1084
1083 got_packet = 0;1085 got_packet = 0;
@@ -1101,9 +1103,6 @@ static int encode_audio_frame(AVFormatContext *s, OutputStream *ost, · 17 unmodified lines
1101 av_free_packet(&pkt);1103 av_free_packet(&pkt);
1102 }1104 }
1103 1105
1104 if (frame)
1105 ost->sync_opts += frame->nb_samples;
1106
1107 return ret;1106 return ret;
1108}1107}
1109 1108
@@ -1356,6 +1355,8 @@ static void do_subtitle_out(AVFormatContext *s, · 246 unmodified lines
1356 nb = 1;1355 nb = 1;
1357 1356
1358 for (i = 0; i < nb; i++) {1357 for (i = 0; i < nb; i++) {
1358 ost->sync_opts = av_rescale_q(pts, ist->st->time_base, enc->time_base);
1359
1359 sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);1360 sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);
1360 // start_display_time is required to be 01361 // start_display_time is required to be 0
1361 sub->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, AV_TIME_BASE_Q);1362 sub->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, AV_TIME_BASE_Q);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t