mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avfilter/vf_framepack: fix timestamps for frameseq format
This commit is contained in:
parent
d52342a563
commit
ef466a8b29
@ -48,8 +48,6 @@ typedef struct FramepackContext {
|
|||||||
enum AVStereo3DType format; ///< frame pack type output
|
enum AVStereo3DType format; ///< frame pack type output
|
||||||
|
|
||||||
AVFrame *input_views[2]; ///< input frames
|
AVFrame *input_views[2]; ///< input frames
|
||||||
|
|
||||||
int64_t double_pts; ///< new pts for frameseq mode
|
|
||||||
} FramepackContext;
|
} FramepackContext;
|
||||||
|
|
||||||
static const enum AVPixelFormat formats_supported[] = {
|
static const enum AVPixelFormat formats_supported[] = {
|
||||||
@ -120,8 +118,6 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
case AV_STEREO3D_FRAMESEQUENCE:
|
case AV_STEREO3D_FRAMESEQUENCE:
|
||||||
time_base.den *= 2;
|
time_base.den *= 2;
|
||||||
frame_rate.num *= 2;
|
frame_rate.num *= 2;
|
||||||
|
|
||||||
s->double_pts = AV_NOPTS_VALUE;
|
|
||||||
break;
|
break;
|
||||||
case AV_STEREO3D_COLUMNS:
|
case AV_STEREO3D_COLUMNS:
|
||||||
case AV_STEREO3D_SIDEBYSIDE:
|
case AV_STEREO3D_SIDEBYSIDE:
|
||||||
@ -312,12 +308,12 @@ static int try_push_frame(AVFilterContext *ctx)
|
|||||||
if (!(s->input_views[0] && s->input_views[1]))
|
if (!(s->input_views[0] && s->input_views[1]))
|
||||||
return 0;
|
return 0;
|
||||||
if (s->format == AV_STEREO3D_FRAMESEQUENCE) {
|
if (s->format == AV_STEREO3D_FRAMESEQUENCE) {
|
||||||
if (s->double_pts == AV_NOPTS_VALUE)
|
int64_t pts = s->input_views[0]->pts;
|
||||||
s->double_pts = s->input_views[LEFT]->pts;
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
// set correct timestamps
|
// set correct timestamps
|
||||||
s->input_views[i]->pts = s->double_pts++;
|
if (pts != AV_NOPTS_VALUE)
|
||||||
|
s->input_views[i]->pts = i == 0 ? pts * 2 : s->input_views[1]->pts + pts;
|
||||||
|
|
||||||
// set stereo3d side data
|
// set stereo3d side data
|
||||||
stereo = av_stereo3d_create_side_data(s->input_views[i]);
|
stereo = av_stereo3d_create_side_data(s->input_views[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user