diff mbox

[FFmpeg-devel] avcodec/decode: also check for FF_CODEC_CAP_SETS_PKT_DTS in audio decoders

Message ID 20170501233247.4876-1-jamrial@gmail.com
State Accepted
Commit b3570f03893cc6f29472f418a144252fe7a5e207
Headers show

Commit Message

James Almer May 1, 2017, 11:32 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/decode.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Michael Niedermayer May 2, 2017, 8:38 p.m. UTC | #1
On Mon, May 01, 2017 at 08:32:47PM -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/decode.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

should be ok

thx

[...]
James Almer May 2, 2017, 11:49 p.m. UTC | #2
On 5/2/2017 5:38 PM, Michael Niedermayer wrote:
> On Mon, May 01, 2017 at 08:32:47PM -0300, James Almer wrote:
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  libavcodec/decode.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> should be ok
> 
> thx

Pushed.
diff mbox

Patch

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index edfae5583c..a54653f5a0 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -413,9 +413,9 @@  FF_ENABLE_DEPRECATION_WARNINGS
     } else {
         ret = avctx->codec->decode(avctx, frame, &got_frame, &tmp);
 
+        if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
+            frame->pkt_dts = pkt->dts;
         if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) {
-            if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
-                frame->pkt_dts = pkt->dts;
             if(!avctx->has_b_frames)
                 frame->pkt_pos = pkt->pos;
             //FIXME these should be under if(!avctx->has_b_frames)
@@ -426,8 +426,6 @@  FF_ENABLE_DEPRECATION_WARNINGS
                 if (!frame->height)                   frame->height              = avctx->height;
                 if (frame->format == AV_PIX_FMT_NONE) frame->format              = avctx->pix_fmt;
             }
-        } else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) {
-            frame->pkt_dts = pkt->dts;
         }
     }
     emms_c();