libavformat.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --- mediatomb-0.12.1.orig/src/metadata/ffmpeg_handler.cc 2012-06-18 02:50:35.000000000 -0400
  2. +++ mediatomb-0.12.1/src/metadata/ffmpeg_handler.cc 2012-06-18 02:59:02.000000000 -0400
  3. @@ -107,8 +107,8 @@
  4. return;
  5. for (const mapping_t *m = mapping; m->avname != NULL; m++)
  6. {
  7. - AVMetadataTag *tag = NULL;
  8. - tag = av_metadata_get(pFormatCtx->metadata, m->avname, NULL, 0);
  9. + AVDictionaryEntry *tag = NULL;
  10. + tag = av_dict_get(pFormatCtx->metadata, m->avname, NULL, 0);
  11. if (tag && tag->value && tag->value[0])
  12. {
  13. log_debug("Added metadata %s: %s\n", m->avname, tag->value);
  14. @@ -278,7 +278,7 @@
  15. int x = 0;
  16. int y = 0;
  17. - AVFormatContext *pFormatCtx;
  18. + AVFormatContext *pFormatCtx = avformat_alloc_context();
  19. // Suppress all log messages
  20. av_log_set_callback(FfmpegNoOutputStub);
  21. @@ -286,15 +286,15 @@
  22. // Register all formats and codecs
  23. av_register_all();
  24. - // Open video file
  25. - if (av_open_input_file(&pFormatCtx,
  26. - item->getLocation().c_str(), NULL, 0, NULL) != 0)
  27. + // Open video file
  28. + if (avformat_open_input(&pFormatCtx,
  29. + item->getLocation().c_str(), NULL, NULL) != 0)
  30. return; // Couldn't open file
  31. // Retrieve stream information
  32. - if (av_find_stream_info(pFormatCtx) < 0)
  33. + if (avformat_find_stream_info(pFormatCtx,NULL) < 0)
  34. {
  35. - av_close_input_file(pFormatCtx);
  36. + avformat_close_input(&pFormatCtx);
  37. return; // Couldn't find stream information
  38. }
  39. // Add metadata using ffmpeg library calls
  40. @@ -303,7 +303,7 @@
  41. addFfmpegResourceFields(item, pFormatCtx, &x, &y);
  42. // Close the video file
  43. - av_close_input_file(pFormatCtx);
  44. + avformat_close_input(&pFormatCtx);
  45. }
  46. Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t *data_size)