mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
avcodec/(dca|tta|pcm-bluray|pcm-dvd|wavpack)enc: Set pts+dur generically
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
52dcf0e0f5
commit
7360e97e4b
@ -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…
x
Reference in New Issue
Block a user