diff mbox

[FFmpeg-devel,1/2] ffplay: use decoder avctx for decoded subtitle width/height

Message ID 1475338662-16821-1-git-send-email-cus@passwd.hu
State Accepted
Commit d14b240ecfc575e2b238d6b47caf1ff764c95b40
Headers show

Commit Message

Marton Balint Oct. 1, 2016, 4:17 p.m. UTC
Fixes ticket #5873.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 ffplay.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Josh Dekker Oct. 1, 2016, 7:42 p.m. UTC | #1
On 01/10/2016 17:17, Marton Balint wrote:
> Fixes ticket #5873.
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  ffplay.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/ffplay.c b/ffplay.c
> index e64909a..a7a6785 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -2224,7 +2224,6 @@ static int video_thread(void *arg)
>  static int subtitle_thread(void *arg)
>  {
>      VideoState *is = arg;
> -    AVCodecParameters *codecpar = is->subtitle_st->codecpar;
>      Frame *sp;
>      int got_subtitle;
>      double pts;
> @@ -2243,8 +2242,8 @@ static int subtitle_thread(void *arg)
>                  pts = sp->sub.pts / (double)AV_TIME_BASE;
>              sp->pts = pts;
>              sp->serial = is->subdec.pkt_serial;
> -            sp->width = codecpar->width;
> -            sp->height = codecpar->height;
> +            sp->width = is->subdec.avctx->width;
> +            sp->height = is->subdec.avctx->height;
>              sp->uploaded = 0;
>
>              /* now we can update the picture count */
>

Feels backwards to go to a avctx from codecpar, but if it fixes 5873 
then it's fine, it can always be changed back again in the future--so LGTM.

--
Josh
Marton Balint Oct. 2, 2016, 2:03 p.m. UTC | #2
On Sat, 1 Oct 2016, Josh de Kock wrote:

> On 01/10/2016 17:17, Marton Balint wrote:
>> Fixes ticket #5873.
>>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  ffplay.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/ffplay.c b/ffplay.c
>> index e64909a..a7a6785 100644
>> --- a/ffplay.c
>> +++ b/ffplay.c
>> @@ -2224,7 +2224,6 @@ static int video_thread(void *arg)
>>  static int subtitle_thread(void *arg)
>>  {
>>      VideoState *is = arg;
>> -    AVCodecParameters *codecpar = is->subtitle_st->codecpar;
>>      Frame *sp;
>>      int got_subtitle;
>>      double pts;
>> @@ -2243,8 +2242,8 @@ static int subtitle_thread(void *arg)
>>                  pts = sp->sub.pts / (double)AV_TIME_BASE;
>>              sp->pts = pts;
>>              sp->serial = is->subdec.pkt_serial;
>> -            sp->width = codecpar->width;
>> -            sp->height = codecpar->height;
>> +            sp->width = is->subdec.avctx->width;
>> +            sp->height = is->subdec.avctx->height;
>>              sp->uploaded = 0;
>>
>>              /* now we can update the picture count */
>>
>
> Feels backwards to go to a avctx from codecpar, but if it fixes 5873 
> then it's fine, it can always be changed back again in the future--so LGTM.
>

Pushed both patches, thanks.

Marton
diff mbox

Patch

diff --git a/ffplay.c b/ffplay.c
index e64909a..a7a6785 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2224,7 +2224,6 @@  static int video_thread(void *arg)
 static int subtitle_thread(void *arg)
 {
     VideoState *is = arg;
-    AVCodecParameters *codecpar = is->subtitle_st->codecpar;
     Frame *sp;
     int got_subtitle;
     double pts;
@@ -2243,8 +2242,8 @@  static int subtitle_thread(void *arg)
                 pts = sp->sub.pts / (double)AV_TIME_BASE;
             sp->pts = pts;
             sp->serial = is->subdec.pkt_serial;
-            sp->width = codecpar->width;
-            sp->height = codecpar->height;
+            sp->width = is->subdec.avctx->width;
+            sp->height = is->subdec.avctx->height;
             sp->uploaded = 0;
 
             /* now we can update the picture count */