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
10781078 av_log(NULL, AV_LOG_FATAL, "Audio encoding failed\n");
10791079 exit_program(1);
10801080 }
1081+
1082+ ost->sync_opts += frame->nb_samples;
10811083 }
10821084
10831085 got_packet = 0;
@@ -1101,9 +1103,6 @@ static int encode_audio_frame(AVFormatContext *s, OutputStream *ost, · 17 unmodified lines
11011103 av_free_packet(&pkt);
11021104 }
11031105
1104− if (frame)
1105− ost->sync_opts += frame->nb_samples;
1106−
11071106 return ret;
11081107 }
11091108
@@ -1356,6 +1355,8 @@ static void do_subtitle_out(AVFormatContext *s, · 246 unmodified lines
13561355 nb = 1;
13571356
13581357 for (i = 0; i < nb; i++) {
1358+ ost->sync_opts = av_rescale_q(pts, ist->st->time_base, enc->time_base);
1359+
13591360 sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);
13601361 // start_display_time is required to be 0
13611362 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