avcodec/(dca|tta|pcm-bluray|pcm-dvd|wavpack)enc: Set pts+dur generically

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/388/head
Andreas Rheinhardt 3 years ago
parent 52dcf0e0f5
commit 7360e97e4b
  1. 4
      libavcodec/dcaenc.c
  2. 3
      libavcodec/pcm-blurayenc.c
  3. 3
      libavcodec/pcm-dvdenc.c
  4. 3
      libavcodec/ttaenc.c
  5. 3
      libavcodec/wavpackenc.c

@ -39,8 +39,6 @@
#include "dcaenc.h"
#include "encode.h"
#include "fft.h"
#include "internal.h"
#include "mathops.h"
#include "put_bits.h"
#define MAX_CHANNELS 6
@ -1215,8 +1213,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
flush_put_bits(&c->pb);
memset(put_bits_ptr(&c->pb), 0, put_bytes_left(&c->pb, 0));
avpkt->pts = frame->pts;
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
*got_packet_ptr = 1;
return 0;
}

@ -23,7 +23,6 @@
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#include "internal.h"
typedef struct BlurayPCMEncContext {
uint16_t header; // Header added to every frame
@ -266,8 +265,6 @@ static int pcm_bluray_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return AVERROR_BUG;
}
avpkt->pts = frame->pts;
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
*got_packet_ptr = 1;
return 0;

@ -24,7 +24,6 @@
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#include "internal.h"
typedef struct PCMDVDContext {
uint8_t header[3]; // Header added to every frame
@ -167,8 +166,6 @@ static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
break;
}
avpkt->pts = frame->pts;
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
*got_packet_ptr = 1;
return 0;

@ -25,7 +25,6 @@
#include "codec_internal.h"
#include "encode.h"
#include "put_bits.h"
#include "internal.h"
#include "libavutil/crc.h"
typedef struct TTAEncContext {
@ -188,9 +187,7 @@ pkt_alloc:
put_bits32(&pb, av_crc(s->crc_table, UINT32_MAX, avpkt->data, out_bytes) ^ UINT32_MAX);
flush_put_bits(&pb);
avpkt->pts = frame->pts;
avpkt->size = out_bytes + 4;
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
*got_packet_ptr = 1;
return 0;
}

@ -26,7 +26,6 @@
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "internal.h"
#include "put_bits.h"
#include "bytestream.h"
#include "wavpackenc.h"
@ -2905,9 +2904,7 @@ static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
s->sample_index += frame->nb_samples;
avpkt->pts = frame->pts;
avpkt->size = buf - avpkt->data;
avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
*got_packet_ptr = 1;
return 0;
}

Loading…
Cancel
Save