[FFmpeg-devel] avformat/utils: set AV_PKT_FLAG_KEY for data packets

Submitted by Baptiste Coudurier on July 30, 2018, 6:16 p.m.

Details

Message ID 20180730181629.3580-1-baptiste.coudurier@gmail.com
State Accepted
Commit dc58e33dd35e1a216cdc1a629d1ea8ee4429fbbb
Headers show

Commit Message

Baptiste Coudurier July 30, 2018, 6:16 p.m.
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Baptiste Coudurier Aug. 21, 2018, 7:19 p.m.
On Mon, Jul 30, 2018 at 11:16 AM, Baptiste Coudurier <
baptiste.coudurier@gmail.com> wrote:

> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index c9cdd2b470..b15f20dd23 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1405,7 +1405,7 @@ static void compute_pkt_fields(AVFormatContext *s,
> AVStream *st,
>              presentation_delayed, delay, av_ts2str(pkt->pts),
> av_ts2str(pkt->dts), av_ts2str(st->cur_dts));
>
>      /* update flags */
> -    if (is_intra_only(st->codecpar->codec_id))
> +    if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA ||
> is_intra_only(st->codecpar->codec_id))
>          pkt->flags |= AV_PKT_FLAG_KEY;
>  #if FF_API_CONVERGENCE_DURATION
>  FF_DISABLE_DEPRECATION_WARNINGS
>

Will apply.
Baptiste Coudurier Sept. 24, 2018, 8:51 p.m.
On Tue, Aug 21, 2018 at 12:19 PM Baptiste Coudurier <
baptiste.coudurier@gmail.com> wrote:

> On Mon, Jul 30, 2018 at 11:16 AM, Baptiste Coudurier <
> baptiste.coudurier@gmail.com> wrote:
>
>> ---
>>  libavformat/utils.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/utils.c b/libavformat/utils.c
>> index c9cdd2b470..b15f20dd23 100644
>> --- a/libavformat/utils.c
>> +++ b/libavformat/utils.c
>> @@ -1405,7 +1405,7 @@ static void compute_pkt_fields(AVFormatContext *s,
>> AVStream *st,
>>              presentation_delayed, delay, av_ts2str(pkt->pts),
>> av_ts2str(pkt->dts), av_ts2str(st->cur_dts));
>>
>>      /* update flags */
>> -    if (is_intra_only(st->codecpar->codec_id))
>> +    if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA ||
>> is_intra_only(st->codecpar->codec_id))
>>          pkt->flags |= AV_PKT_FLAG_KEY;
>>  #if FF_API_CONVERGENCE_DURATION
>>  FF_DISABLE_DEPRECATION_WARNINGS
>>
>
> Will apply.
>

Applied

Patch hide | download patch | download mbox

diff --git a/libavformat/utils.c b/libavformat/utils.c
index c9cdd2b470..b15f20dd23 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1405,7 +1405,7 @@  static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
             presentation_delayed, delay, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts));
 
     /* update flags */
-    if (is_intra_only(st->codecpar->codec_id))
+    if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA || is_intra_only(st->codecpar->codec_id))
         pkt->flags |= AV_PKT_FLAG_KEY;
 #if FF_API_CONVERGENCE_DURATION
 FF_DISABLE_DEPRECATION_WARNINGS