summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubdec.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2013-09-29 22:11:13 +0200
committerClément Bœsch <u@pkh.me>2013-10-04 07:59:48 +0200
commit71e0ae22aca7dbe13a127ed305b3ef987c9abc58 (patch)
treeecabadbc3147122331c62eac9b2b87ba05f445f5 /libavcodec/dvdsubdec.c
parent41fd6f07961be91507664103386678cb6e50911b (diff)
avcodec/dvdsubdec: extract every subtitle in a different file (debug).
Even thought a generic solution would be more relevant, this is currently helpful while debugging.
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 83ed27e9c8..9caf176dba 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -35,6 +35,9 @@ typedef struct DVDSubContext
int has_palette;
uint8_t colormap[4];
uint8_t alpha[256];
+#ifdef DEBUG
+ int sub_id;
+#endif
} DVDSubContext;
static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values)
@@ -504,11 +507,16 @@ static int dvdsub_decode(AVCodecContext *avctx,
goto no_subtitle;
#if defined(DEBUG)
+ {
+ char ppm_name[32];
+
+ snprintf(ppm_name, sizeof(ppm_name), "/tmp/%05d.ppm", ctx->sub_id++);
av_dlog(NULL, "start=%d ms end =%d ms\n",
sub->start_display_time,
sub->end_display_time);
- ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0],
+ ppm_save(ppm_name, sub->rects[0]->pict.data[0],
sub->rects[0]->w, sub->rects[0]->h, sub->rects[0]->pict.data[1]);
+ }
#endif
*data_size = 1;