History

avfilter/vf_framepack: fix timestamps for frameseq format

Paul B Mahol committed 7 years ago

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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_framepack.c+3−7
@@ -48,8 +48,6 @@ typedef struct FramepackContext { · 47 unmodified lines
48 enum AVStereo3DType format; ///< frame pack type output48 enum AVStereo3DType format; ///< frame pack type output
49 49
50 AVFrame *input_views[2]; ///< input frames50 AVFrame *input_views[2]; ///< input frames
51
52 int64_t double_pts; ///< new pts for frameseq mode
53} FramepackContext;51} FramepackContext;
54 52
55static const enum AVPixelFormat formats_supported[] = {53static const enum AVPixelFormat formats_supported[] = {
@@ -120,8 +118,6 @@ static int config_output(AVFilterLink *outlink) · 64 unmodified lines
120 case AV_STEREO3D_FRAMESEQUENCE:118 case AV_STEREO3D_FRAMESEQUENCE:
121 time_base.den *= 2;119 time_base.den *= 2;
122 frame_rate.num *= 2;120 frame_rate.num *= 2;
123
124 s->double_pts = AV_NOPTS_VALUE;
125 break;121 break;
126 case AV_STEREO3D_COLUMNS:122 case AV_STEREO3D_COLUMNS:
127 case AV_STEREO3D_SIDEBYSIDE:123 case AV_STEREO3D_SIDEBYSIDE:
@@ -312,12 +308,12 @@ static int try_push_frame(AVFilterContext *ctx) · 184 unmodified lines
312 if (!(s->input_views[0] && s->input_views[1]))308 if (!(s->input_views[0] && s->input_views[1]))
313 return 0;309 return 0;
314 if (s->format == AV_STEREO3D_FRAMESEQUENCE) {310 if (s->format == AV_STEREO3D_FRAMESEQUENCE) {
315 if (s->double_pts == AV_NOPTS_VALUE)311 int64_t pts = s->input_views[0]->pts;
316 s->double_pts = s->input_views[LEFT]->pts;
317 312
318 for (i = 0; i < 2; i++) {313 for (i = 0; i < 2; i++) {
319 // set correct timestamps314 // 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;
321 317
322 // set stereo3d side data318 // set stereo3d side data
323 stereo = av_stereo3d_create_side_data(s->input_views[i]);319 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