History

avfilter/vf_framepack: fix timestamps for frameseq format

Paul B Mahol committed 7 years ago

Commit ef466a81 parent d52342a1 file · +3 −7Browse files

Unified · Split

libavfilter/vf_framepack.c+3−7
@@ -48,8 +48,6 @@ typedef struct FramepackContext { · 47 unmodified lines
4848 enum AVStereo3DType format; ///< frame pack type output
4949
5050 AVFrame *input_views[2]; ///< input frames
51−
52− int64_t double_pts; ///< new pts for frameseq mode
5351 } FramepackContext;
5452
5553 static const enum AVPixelFormat formats_supported[] = {
@@ -120,8 +118,6 @@ static int config_output(AVFilterLink *outlink) · 64 unmodified lines
120118 case AV_STEREO3D_FRAMESEQUENCE:
121119 time_base.den *= 2;
122120 frame_rate.num *= 2;
123−
124− s->double_pts = AV_NOPTS_VALUE;
125121 break;
126122 case AV_STEREO3D_COLUMNS:
127123 case AV_STEREO3D_SIDEBYSIDE:
@@ -312,12 +308,12 @@ static int try_push_frame(AVFilterContext *ctx) · 184 unmodified lines
312308 if (!(s->input_views[0] && s->input_views[1]))
313309 return 0;
314310 if (s->format == AV_STEREO3D_FRAMESEQUENCE) {
315− if (s->double_pts == AV_NOPTS_VALUE)
316− s->double_pts = s->input_views[LEFT]->pts;
311+ int64_t pts = s->input_views[0]->pts;
317312
318313 for (i = 0; i < 2; i++) {
319314 // set correct timestamps
320− s->input_views[i]->pts = s->double_pts++;
315+ if (pts != AV_NOPTS_VALUE)
316+ s->input_views[i]->pts = i == 0 ? pts * 2 : s->input_views[1]->pts + pts;
321317
322318 // set stereo3d side data
323319 stereo = av_stereo3d_create_side_data(s->input_views[i]);

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